-
Notifications
You must be signed in to change notification settings - Fork 5
/
angular.html
559 lines (552 loc) · 39.4 KB
/
angular.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
<!DOCTYPE html>
<html>
<head>
<title>Dart Cheat Sheet [AngularDart]</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./favicon.ico" rel="icon" type="image/x-icon" />
<link href="./favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="css/main.css" rel="stylesheet">
<link href="css/angular.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700%7CAnton' rel='stylesheet' type='text/css'>
<meta name="description" content="The cheat sheet references main classes and methods from Dart SDK.">
<meta name="author" content="Guillaume Girou, Nicolas François, Vincent Bostoen">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42028125-2', 'dartlangfr.net');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="header">
<h1>
<img alt="Dart Logo" src="img/dart-logo.png"/>
AngularDart
<span class="noprint" style="display: inline">
<span class="g-plusone" data-href="http://dartlangfr.net/dart-cheat-sheet/"></span>
</span>
</h1>
<div class="nav">
<ul>
<li>
<div class="btn-group">
<a href="core.html" class="btn btn-default"><img src="img/core32.png" alt="Core"> Core</a>
<a href="html.html" class="btn btn-default"><img src="img/html32.png" alt="HTML"> HTML</a>
<a href="angular.html" class="btn btn-default active"><img src="img/angular32.png" alt="HTML"> AngularDart</a>
</div>
</li>
</ul>
</div>
</div>
<div id="content">
<div class="grid">
<div id="bootstrap-section" class="section-container">
<p>Bootstrap</p>
<div class="section">
<p>HTML</p>
<pre class="lang-html"><span class="tag"><html</span><span class="pln"> </span><span class="atn">ng-app</span><span class="tag">></span><span class="pln">
</span><span class="tag"><body></span><span class="pln">
...
</span><span class="tag"><script</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"application/dart"</span><span class="pln">
</span><span class="atn">src</span><span class="pun">=</span><span class="atv">"main.dart"</span><span class="tag">></script></span><span class="pln">
</span><span class="tag"><script</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln">
</span><span class="atn">src</span><span class="pun">=</span><span class="atv">"packages/browser/dart.js"</span><span class="tag">></script></span><span class="pln">
</span><span class="tag"></body></span><span class="pln">
</span><span class="tag"></html></span></pre>
</div>
<div class="section">
<p>main.dart script</p>
<pre class="lang-dart"><span class="kwd">import</span><span class="pln"> </span><span class="str">'package:angular/angular.dart'</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> </span><span class="str">'package:angular/application_factory.dart'</span><span class="pun">;</span><span class="pln">
main</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
applicationFactory</span><span class="pun">().</span><span class="pln">run</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span></pre>
</div>
</div>
<div id="root-context-section" class="section-container">
<p>Root Context</p>
<div class="section">
<p>Declaration:</p>
<pre class="lang-dart"><span class="lit">@Injectable</span><span class="pun">()</span><span class="pln">
</span><span class="kwd">class</span><span class="pln"> </span><span class="typ">RootContext</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
bool visible</span><span class="pun">;</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> name</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span></pre>
</div>
<div class="section">
<p>Registration:</p>
<pre class="lang-dart"><span class="pln">main</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
applicationFactory</span><span class="pun">()</span><span class="pln">
</span><span class="pun">.</span><span class="pln">rootContextType</span><span class="pun">(</span><span class="typ">RootContext</span><span class="pun">)</span><span class="pln">
</span><span class="pun">.</span><span class="pln">run</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span></pre>
</div>
<div class="section">
<p>HTML</p>
<pre class="lang-html"><span class="tag"><span</span><span class="pln"> </span><span class="atn">ng-if</span><span class="pun">=</span><span class="atv">"visible"</span><span class="tag">></span><span class="pln">Hello {{name}}!</span><span class="tag"></span></span></pre>
</div>
</div>
<div id="module-section" class="section-container">
<p>Module</p>
<div class="section">
<p>Declaration:</p>
<pre class="lang-dart"><span class="kwd">class</span><span class="pln"> </span><span class="typ">MyAppModule</span><span class="pln"> </span><span class="kwd">extends</span><span class="pln"> </span><span class="typ">Module</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="typ">MyAppModule</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
install</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">AnotherModule</span><span class="pun">());</span><span class="pln">
bind</span><span class="pun">(</span><span class="typ">TypeToBind</span><span class="pun">);</span><span class="pln">
bindByKey</span><span class="pun">(</span><span class="typ">KeyToBind</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span></pre>
</div>
<div class="section">
<p>Registration:</p>
<pre class="lang-dart"><span class="pln">main</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
applicationFactory</span><span class="pun">()</span><span class="pln">
</span><span class="pun">.</span><span class="pln">addModule</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">MyAppModule</span><span class="pun">())</span><span class="pln">
</span><span class="pun">.</span><span class="pln">run</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span></pre>
</div>
</div>
<div id="binding-section" class="section-container">
<p>Bindings</p>
<div class="section">
<p>One-way binding:</p>
<pre class="lang-html"><span class="tag"><span></span><span class="pln">{{ expr }}</span><span class="tag"></span></span><span class="pln">
</span><span class="tag"><span</span><span class="pln"> </span><span class="atn">ng-bind</span><span class="pun">=</span><span class="atv">" expr "</span><span class="tag">></span></span></pre>
</div>
<div class="section">
<p>Two-way binding:</p>
<pre class="lang-html"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text"</span><span class="pln"> </span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">" expr "</span><span class="tag">></span></pre>
</div>
</div>
<div id="expressions-section" class="section-container">
<p>Expressions</p>
<div class="section">
<p>Statements:</p>
<pre class="lang-dart"><span class="pln">expr</span><span class="pun">;</span><span class="pln"> expr</span><span class="pun">;</span><span class="pln"> expr</span></pre>
</div>
<div class="section">
<p>Member access:</p>
<pre class="lang-dart"><span class="pln">field
nested</span><span class="pun">.</span><span class="pln">otherNested</span><span class="pun">.</span><span class="pln">field
list</span><span class="pun">[</span><span class="lit">42</span><span class="pun">]</span><span class="pln">
map</span><span class="pun">[</span><span class="str">'key'</span><span class="pun">]</span></pre>
</div>
<div class="section">
<p>Function call:</p>
<pre class="lang-dart"><span class="pln">toggle()</span><span class="pln">
obj</span><span class="pun">.</span><span class="pln">distance</span><span class="pun">(</span><span class="lit">42</span><span class="pun">,</span><span class="pln"> y</span><span class="pun">)</span></pre>
</div>
<div class="section">
<p>List / Map literals:</p>
<pre class="lang-dart"><span class="pun">[</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">,</span><span class="pln"> </span><span class="lit">3</span><span class="pun">]</span><span class="pln">
</span><span class="pun">{</span><span class="str">'question'</span><span class="pun">:</span><span class="pln"> </span><span class="str">'?'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'response'</span><span class="pun">:</span><span class="pln"> </span><span class="lit">42</span><span class="pun">}</span></pre>
</div>
<div class="section">
<p>Assignment:</p>
<pre class="lang-dart"><span class="pln">field </span><span class="pun">=</span><span class="pln"> value
nested</span><span class="pun">.</span><span class="pln">field </span><span class="pun">=</span><span class="pln"> value
list</span><span class="pun">[</span><span class="lit">42</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> value
map</span><span class="pun">[</span><span class="str">'key'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> value</span></pre>
</div>
<div class="section">
<p>Ternary operator:</p>
<pre class="lang-dart"><span class="pln">a </span><span class="pun">?</span><span class="pln"> b </span><span class="pun">:</span><span class="pln"> c</span></pre>
</div>
<div class="section">
<p>Filters:</p>
<pre class="lang-dart"><span class="pln">name </span><span class="pun">|</span><span class="pln"> uppercase
items </span><span class="pun">|</span><span class="pln"> limitTo</span><span class="pun">:</span><span class="lit">2</span><span class="pln">
items </span><span class="pun">|</span><span class="pln"> limitTo</span><span class="pun">:</span><span class="lit">2</span><span class="pln"> </span><span class="pun">|</span><span class="pln"> uppercase</span></pre>
</div>
</div>
<div id="model-section" class="section-container">
<p>Model directives</p>
<div class="section">
<p>Checkbox</p>
<pre class="lang-html"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"checkbox"</span><span class="pln">
</span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"expr"</span><span class="pln">
[</span><span class="atn">ng-true-value</span><span class="pun">=</span><span class="atv">"t_expr"</span><span class="pln">]
[</span><span class="atn">ng-false-value</span><span class="pun">=</span><span class="atv">"f_expr"</span><span class="pln">]</span><span class="tag">></span></pre>
</div>
<div class="section">
<p>Date / Time</p>
<pre class="lang-html"><span class="tag"><input</span><span class="pln">
</span><span class="atn">type</span><span class="pun">=</span><span class="atv">"date|datetime|datetime-local|month|time|week"</span><span class="pln">
[</span><span class="atn">ng-bind-type</span><span class="pun">=</span><span class="atv">"date"</span><span class="pln">]
</span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"myModel"</span><span class="tag">></span></pre>
</div>
<div class="section">
<p>Numbers</p>
<pre class="lang-html"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"number|range"</span><span class="pln"> </span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"myModel"</span><span class="tag">></span></pre>
</div>
<div class="section">
<p>Radio</p>
<pre class="lang-html"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"radio"</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"foo"</span><span class="pln"> </span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"category"</span><span class="tag">></span></pre>
</div>
<div class="section">
<p>Select</p>
<pre class="lang-html"><span class="tag"><select</span><span class="pln"> </span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"selectedValue"</span><span class="tag">></span><span class="pln">
...
</span><span class="tag"></select></span></pre>
</div>
<div class="section">
<p>Texts</p>
<pre class="lang-html"><span class="tag"><input</span><span class="pln">
</span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text|url|password|email|search|tel"</span><span class="pln">
</span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"myModel"</span><span class="tag">></span><span class="pln">
</span><span class="tag"><textarea</span><span class="pln"> </span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"myModel"</span><span class="tag">></textarea></span></pre>
</div>
<div class="section">
<p>Content editable</p>
<pre class="lang-html"><span class="tag"><span</span><span class="pln"> </span><span class="atn">contenteditable</span><span class="pln"> </span><span class="atn">ng-model</span><span class="pun">=</span><span class="atv">"name"</span><span class="tag">></span></pre>
</div>
</div>
<div id="attribute-section" class="section-container">
<p>Attribute directives</p>
<div class="section">
<p>Source attributes</p>
<div class="section-content">
<pre class="lang-html"><span class="tag"><img</span><span class="pln"> </span><span class="atn">ng-src</span><span class="pun">=</span><span class="atv">"{{username}}.png"</span><span class="tag">></span><span class="pln">.</span></pre>
</div>
<ul class="section-content column3">
<li>ng-href</li>
<li>ng-src</li>
<li>ng-srcset</li>
</ul>
</div>
<div class="section">
<p>Boolean attributes</p>
<div class="section-content">
<pre class="lang-html"><span class="tag"><button</span><span class="pln"> </span><span class="atn">ng-disabled</span><span class="pun">=</span><span class="atv">"{{false}}"</span><span class="tag">></span></pre>
</div>
<ul class="section-content column3">
<li>ng-checked</li>
<li>ng-disabled</li>
<li>ng-multiple</li>
<li>ng-open</li>
<li>ng-readonly</li>
<li>ng-required</li>
<li>ng-selected</li>
</ul>
</div>
<div class="section">
<p>Other attributes</p>
<pre class="lang-html"><span class="tag"><svg></span><span class="pln">
</span><span class="tag"><circle</span><span class="pln"> </span><span class="atn">ng-attr-cx</span><span class="pun">=</span><span class="atv">"{{cx}}"</span><span class="tag">></circle></span><span class="pln">
</span><span class="tag"></svg></span></pre>
</div>
</div>
<div id="events-section" class="section-container">
<p>Event directives</p>
<div class="section">
<p>Element events</p>
<ul class="section-content column3">
<li>ng-abort</li>
<li>ng-beforecopy</li>
<li>ng-beforecut</li>
<li>ng-beforepaste</li>
<li>ng-blur</li>
<li>ng-change</li>
<li>ng-copy</li>
<li>ng-cut</li>
<li>ng-error</li>
<li>ng-focus</li>
<li>ng-fullscreenchange</li>
<li>ng-fullscreenerror</li>
<li>ng-input</li>
<li>ng-invalid</li>
<li>ng-load</li>
<li>ng-paste</li>
<li>ng-reset</li>
<li>ng-scroll</li>
<li>ng-search</li>
<li>ng-select</li>
<li>ng-selectstart</li>
<li>ng-submit</li>
</ul>
</div>
<div class="section">
<p>Mouse events</p>
<ul class="section-content column3">
<li>ng-click</li>
<li>ng-doubleclick</li>
<li>ng-contextmenu</li>
<li>ng-drag</li>
<li>ng-dragstart</li>
<li>ng-dragend</li>
<li>ng-dragenter</li>
<li>ng-dragover</li>
<li>ng-dragleave</li>
<li>ng-drop</li>
<li>ng-mousedown</li>
<li>ng-mouseenter</li>
<li>ng-mouseleave</li>
<li>ng-mousemove</li>
<li>ng-mouseover</li>
<li>ng-mouseup</li>
<li>ng-mousewheel</li>
<li>ng-mouseout</li>
</ul>
</div>
<div class="section">
<p>Keyboard events</p>
<ul class="section-content column3">
<li>ng-keydown</li>
<li>ng-keypress</li>
<li>ng-keyup</li>
</ul>
</div>
<div class="section">
<p>Touch events</p>
<ul class="section-content column3">
<li>ng-toucheancel</li>
<li>ng-touchend</li>
<li>ng-touchenter</li>
<li>ng-touchleave</li>
<li>ng-touchmove</li>
<li>ng-touchstart</li>
</ul>
</div>
<div class="section">
<p>Other events</p>
<ul class="section-content">
<li>ng-transitionend</li>
</ul>
</div>
<div class="section">
<p>Examples</p>
<pre class="lang-html"><span class="tag"><button</span><span class="pln"> </span><span class="atn">ng-click</span><span class="pun">=</span><span class="atv">" lastEvent = 'Click' "</span><span class="pln">
</span><span class="atn">ng-doubleclick</span><span class="pun">=</span><span class="atv">" lastEvent = 'DblClick' "</span><span class="tag">></span><span class="pln">
lastEvent: {{lastEvent}}
</span><span class="tag"></button></span></pre>
</div>
</div>
<div id="template-section" class="section-container">
<p>Template directives</p>
<div class="section">
<p>ng-bind / ng-bind-html / ng-bind-template</p>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-bind</span><span class="pun">=</span><span class="atv">"expression"</span><span class="tag">></div></span><span class="pln">
</span><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-bind-html</span><span class="pun">=</span><span class="atv">"expression"</span><span class="tag">></div></span><span class="pln">
</span><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-bind-template</span><span class="pun">=</span><span class="atv">"{{salutation}} {{name}}!"</span><span class="tag">></span></pre>
</div>
<div class="section">
<p>ng-show / ng-hide</p>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-show</span><span class="pun">=</span><span class="atv">"myValue"</span><span class="tag">></div></span></pre>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-hide</span><span class="pun">=</span><span class="atv">"myValue"</span><span class="tag">></div></span></pre>
</div>
<div class="section">
<p>ng-if / ng-unless</p>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-if</span><span class="pun">=</span><span class="atv">"condition expression"</span><span class="tag">></span><span class="pln">
Removed from the DOM if ng-if is falsy
</span><span class="tag"></div></span>
<span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-unless</span><span class="pun">=</span><span class="atv">"..."</span><span class="tag">></span><span class="pln">
Removed from the DOM if ng-unless is truthy
</span><span class="tag"></div></span></pre>
</div>
<div class="section">
<p>ng-switch</p>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-switch</span><span class="pun">=</span><span class="atv">"selection"</span><span class="tag">></span><span class="pln">
</span><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-switch-when</span><span class="pun">=</span><span class="atv">"settings"</span><span class="tag">></span><span class="pln">Settings Div</span><span class="tag"></div></span><span class="pln">
</span><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-switch-when</span><span class="pun">=</span><span class="atv">"home"</span><span class="tag">></span><span class="pln">Home Span</span><span class="tag"></div></span><span class="pln">
</span><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-switch-default</span><span class="tag">></span><span class="pln">default</span><span class="tag"></div></span><span class="pln">
</span><span class="tag"></div></span></pre>
</div>
<div class="section">
<p>ng-repeat</p>
<pre class="lang-html"><span class="tag"><ul></span><span class="pln">
</span><span class="tag"><li</span><span class="pln"> </span><span class="atn">ng-repeat</span><span class="pun">=</span><span class="atv">"item in ['foo', 'bar', 'baz']"</span><span class="tag">></span><span class="pln">
{{$index}} : {{item}}
</span><span class="tag"></li></span><span class="pln">
</span><span class="tag"></ul></span></pre>
</div>
<div class="section">
<p>ng-pluralize</p>
<pre class="lang-html"><span class="tag"><ng-pluralize</span><span class="pln"> </span><span class="atn">count</span><span class="pun">=</span><span class="atv">"personCount"</span><span class="pln">
</span><span class="atn">when</span><span class="pun">=</span><span class="atv">"{'0': 'Nobody is viewing.',
'one': '1 person is viewing.',
'other': '{} people are viewing.'}"</span><span class="tag">></span><span class="pln">
</span><span class="tag"></ng-pluralize></span></pre>
</div>
<div class="section">
<p>ng-include</p>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-include</span><span class="pun">=</span><span class="atv">"{{templateUrl}}"</span><span class="tag">></div></span></pre>
</div>
</div>
<div id="style-section" class="section-container">
<p>Style directives</p>
<div class="section">
<p>ng-base-css</p>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-base-css</span><span class="pun">=</span><span class="atv">"my_application.css"</span><span class="tag">></span></pre>
</div>
<div class="section">
<p>ng-class</p>
<pre class="lang-html"><span class="tag"><p</span><span class="pln"> </span><span class="atn">ng-class</span><span class="pun">=</span><span class="atv">"style"</span><span class="tag">></span><span class="pln">String Syntax</span><span class="tag"></p></span></pre>
<pre class="lang-html"><span class="tag"><p</span><span class="pln"> </span><span class="atn">ng-class</span><span class="pun">=</span><span class="atv">"[style1, style2, style3]"</span><span class="tag">></span><span class="pln">Array Syntax</span><span class="tag"></p></span></pre>
<pre class="lang-html"><span class="tag"><p</span><span class="pln"> </span><span class="atn">ng-class</span><span class="pun">=</span><span class="atv">"{
'text-remove': deleted,
'strong': bold,
'alert': caution}"</span><span class="tag">></span><span class="pln">Map Syntax</span><span class="tag"></p></span></pre>
</div>
<div class="section">
<p>ng-style</p>
<pre class="lang-html"><span class="tag"><span</span><span class="pln"> </span><span class="atn">ng-style</span><span class="pun">=</span><span class="atv">"{color: 'red'}"</span><span class="tag">></span><span class="pln">Sample Text</span><span class="tag"></span></span></pre>
</div>
<div class="section">
<p>ng-class-odd / ng-class-even</p>
<pre class="lang-html"><span class="tag"><li</span><span class="pln"> </span><span class="atn">ng-repeat</span><span class="pun">=</span><span class="atv">"name in ['John', 'Mary', 'Cate', 'Suz']"</span><span class="tag">></span><span class="pln">
</span><span class="tag"><span</span><span class="pln"> </span><span class="atn">ng-class-odd</span><span class="pun">=</span><span class="atv">" 'odd' "</span><span class="pln"> </span><span class="atn">ng-class-even</span><span class="pun">=</span><span class="atv">" 'even' "</span><span class="tag">></span><span class="pln">
{{name}}
</span><span class="tag"></span></span><span class="pln">
</span><span class="tag"></li></span></pre>
</div>
<div class="section">
<p>ng-cloak</p>
<pre class="lang-css"><span class="pun">[</span><span class="pln">ng-cloak</span><span class="pun">],</span><span class="pln"> </span><span class="pun">[</span><span class="pln">data-ng-cloak</span><span class="pun">],</span><span class="pln"> </span><span class="pun">.</span><span class="pln">ng-cloak </span><span class="pun">{</span><span class="pln">
</span><span class="kwd">display</span><span class="pun">:</span><span class="pln"> none </span><span class="kwd">!important</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span></pre>
<pre class="lang-html"><span class="tag"><div</span><span class="pln"> </span><span class="atn">ng-cloak</span><span class="tag">></span></pre>
</div>
</div>
<div id="http-section" class="section-container">
<p>Http Service</p>
<div class="section">
<p>Methods</p>
<ul class="section-content column2">
<li>call(url, method, data, params, headers)</li>
<li>delete(url)</li>
<li>get(url)</li>
<li>head(url)</li>
<li>jsonp(url)</li>
<li>post(url, data)</li>
<li>put(url, data)</li>
</ul>
</div>
<div class="section">
<p>Example</p>
<pre class="lang-dart"><span class="pln">http</span><span class="pun">.</span><span class="kwd">get</span><span class="pun">(</span><span class="str">'recipes.json'</span><span class="pun">)</span><span class="pln">
</span><span class="pun">.</span><span class="kwd">then</span><span class="pun">((</span><span class="typ">HttpResponse</span><span class="pln"> response</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span>
<span class="pun">...</span><span class="pln">
</span><span class="pun">});</span></pre>
</div>
</div>
<div id="routing-section" class="section-container">
<p>Routing</p>
<div class="section">
<p>Insertion Point</p>
<pre class="lang-html"><span class="tag"><ng-view></ng-view></span></pre>
</div>
<div class="section">
<p>Routes configuration</p>
<pre class="lang-dart"><span class="pln">initRoutes</span><span class="pun">(</span><span class="typ">Router</span><span class="pln"> router</span><span class="pun">,</span><span class="pln"> </span><span class="typ">RouteViewFactory</span><span class="pln"> views</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
views</span><span class="pun">.</span><span class="pln">configure</span><span class="pun">({</span><span class="pln">
</span><span class="str">'recipes'</span><span class="pun">:</span><span class="pln"> ngRoute</span><span class="pun">(</span><span class="pln">
path</span><span class="pun">:</span><span class="pln"> </span><span class="str">'/recipes'</span><span class="pun">,</span><span class="pln">
view</span><span class="pun">:</span><span class="pln"> </span><span class="str">'recipes.html'</span><span class="pun">),</span><span class="pln">
</span><span class="str">'viewRecipe'</span><span class="pun">:</span><span class="pln"> ngRoute</span><span class="pun">(</span><span class="pln">
path</span><span class="pun">:</span><span class="pln"> </span><span class="str">'/recipe/:recipeId/view'</span><span class="pun">,</span><span class="pln">
view</span><span class="pun">:</span><span class="pln"> </span><span class="str">'recipe.html'</span><span class="pun">),</span><span class="pln">
</span><span class="pun">});</span><span class="pln">
</span><span class="pun">}</span></pre>
</div>
<div class="section">
<p>Module registration</p>
<pre class="lang-dart"><span class="pln">bind</span><span class="pun">(</span><span class="typ">RouteInitializerFn</span><span class="pun">,</span><span class="pln"> toValue</span><span class="pun">:</span><span class="pln"> initRoutes</span><span class="pun">);</span><span class="pln">
bind</span><span class="pun">(</span><span class="typ">NgRoutingUsePushState</span><span class="pun">,</span><span class="pln"> toValue</span><span class="pun">:</span><span class="pln">
</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">NgRoutingUsePushState</span><span class="pun">.</span><span class="pln">value</span><span class="pun">(</span><span class="kwd">false</span><span class="pun">));</span></pre>
</div>
</div>
<div id="custom-section" class="section-container">
<p>Custom Components</p>
<div class="section">
<p>Decorator</p>
<pre class="lang-dart"><span class="lit">@Decorator</span><span class="pun">(</span><span class="pln">
selector</span><span class="pun">:</span><span class="pln"> </span><span class="str">'[tooltip]'</span><span class="pun">,</span><span class="pln">
map</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">const</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="str">'tooltip'</span><span class="pun">:</span><span class="pln"> </span><span class="str">'@text'</span><span class="pln">
</span><span class="pun">})</span><span class="pln">
</span><span class="kwd">class</span><span class="pln"> </span><span class="typ">Tooltip</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="kwd">final</span><span class="pln"> </span><span class="typ">Element</span><span class="pln"> element</span><span class="pun">;</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> text</span><span class="pun">;</span><span class="pln">
</span><span class="typ">Tooltip</span><span class="pun">(</span><span class="kwd">this</span><span class="pun">.</span><span class="pln">element</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="pun">...</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span></pre>
<pre class="lang-html"><span class="tag"><span</span><span class="pln"> </span><span class="atn">tooltip</span><span class="pun">=</span><span class="atv">"Hello World!"</span><span class="tag">></span><span class="pln">...</span><span class="tag"></span></span></pre>
</div>
<div class="section">
<p>Component</p>
<pre class="lang-dart"><span class="lit">@Component</span><span class="pun">(</span><span class="pln">
selector</span><span class="pun">:</span><span class="pln"> </span><span class="str">'rating'</span><span class="pun">,</span><span class="pln">
templateUrl</span><span class="pun">:</span><span class="pln"> </span><span class="str">'rating_component.html'</span><span class="pun">,</span><span class="pln">
cssUrl</span><span class="pun">:</span><span class="pln"> </span><span class="str">'rating_component.css'</span><span class="pun">,</span><span class="pln">
map</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">const</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="str">'rating'</span><span class="pun">:</span><span class="pln"> </span><span class="str">'<=>rating'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'max-rating'</span><span class="pun">:</span><span class="pln"> </span><span class="str">'=>maxRating'</span><span class="pln">
</span><span class="pun">}</span><span class="pun">)</span><span class="pln">
</span><span class="kwd">class</span><span class="pln"> </span><span class="typ">RatingComponent</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> rating</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> maxRating</span><span class="pun">;</span><span class="pln">
</span><span class="pun">...</span><span class="pln">
</span><span class="pun">}</span></pre>
<pre class="lang-html"><span class="tag"><rating</span><span class="pln"> </span><span class="atn">rating</span><span class="pun">=</span><span class="atv">"rating"</span><span class="pln"> </span><span class="atn">max-rating</span><span class="pun">=</span><span class="atv">"5"</span><span class="tag">></rating></span></pre>
</div>
</div>
<div id="formatters-section" class="section-container">
<p>Formatters / Filters</p>
<div class="section">
<p>Built-in Formatters</p>
<ul class="section-content column1">
<li>arrayify</li>
<li>currency[:symbol[:leading]]</li>
<li>date[:format]</li>
<li>filter:expression[:comparator]</li>
<li>json</li>
<li>limitTo:number</li>
<li>lowercase</li>
<li>number[:fractionSize]</li>
<li>orderBy:predicate[:true]</li>
<li>stringify</li>
<li>uppercase</li>
</ul>
</div>
<div class="section">
<p>Usage</p>
<pre>{{ item in items | limitTo:2 }}</pre>
<pre class="lang-html"><span class="tag"><li</span><span class="pln"> </span><span class="atn">ng-repeat</span><span class="pun">=</span><span class="atv">"item in items | limitTo:2"</span><span class="tag">></span><span class="tag"></li></span></pre>
<p>Chaining</p>
<pre>{{ item in items | limitTo:2 | uppercase }}</pre>
</div>
<div class="section">
<p>Custom formaters</p>
<pre class="lang-dart"><span class="lit">@Formatter</span><span class="pun">(</span><span class="pln">name</span><span class="pun">:</span><span class="pln"> </span><span class="str">'camelCase'</span><span class="pun">)</span><span class="pln">
</span><span class="kwd">class</span><span class="pln"> </span><span class="typ">CamelCaseFormatter</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
call</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> text</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="pun">...</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span></pre>
</div>
</div>
</div>
</div>
<div id="footer">
<a href="https://plus.google.com/115816334172157652403">
<img src="img/dartlangfr.png" alt="Dartlang [FR] - ʕ๏̮๏ʔ">
</a>
<div>
+Made by <a href="http://plus.google.com/115049522200141162219"><span>Guillaume Girou</span></a>, <a href="http://plus.google.com/106226789128312528511"><span>Nicolas François</span></a> and <a href="http://plus.google.com/109253530406296308866"><span>Vincent Bostoen</span></a> from
<a href="https://plus.google.com/115816334172157652403"><span>Dartlang [FR] - ʕ๏̮๏ʔ</span></a><br>
<em>AngularDart v1.1.2 - 20150903</em><br>
</div>
</div>
<!-- Google+ +1 button. -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{parsetags: 'explicit'}
</script>
<script type="text/javascript">gapi.plusone.go("header");</script>
</body>
</html>