This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree 6 files changed +11
-11
lines changed
public/docs/_examples/lifecycle-hooks/dart
6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class ChildComponent {
20
20
<div>-- projected content begins --</div>
21
21
<ng-content></ng-content>
22
22
<div>-- projected content ends --</div>
23
- <p *ngIf="comment != null " class="comment">{{comment}}</p>
23
+ <p *ngIf="comment.isNotEmpty " class="comment">{{comment}}</p>
24
24
'''
25
25
// #enddocregion template
26
26
)
Original file line number Diff line number Diff line change @@ -22,16 +22,16 @@ class ChildViewComponent {
22
22
<div>-- child view begins --</div>
23
23
<my-child></my-child>
24
24
<div>-- child view ends --</div>
25
- <p *ngIf="comment != null " class="comment">{{comment}}</p>''' ,
25
+ <p *ngIf="comment.isNotEmpty " class="comment">{{comment}}</p>''' ,
26
26
// #enddocregion template
27
27
directives: const [ChildViewComponent ])
28
28
// #docregion hooks
29
29
class AfterViewComponent implements AfterViewChecked , AfterViewInit {
30
30
var _prevHero = '' ;
31
-
31
+
32
32
// Query for a VIEW child of type `ChildViewComponent`
33
33
@ViewChild (ChildViewComponent ) ChildViewComponent viewChild;
34
-
34
+
35
35
// #enddocregion hooks
36
36
final LoggerService _logger;
37
37
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ import 'spy_directive.dart';
17
17
styles: const [
18
18
'.counter {background: LightYellow; padding: 8px; margin-top: 8px}'
19
19
],
20
- directives: const [Spy ])
21
- class MyCounter implements OnChanges {
20
+ directives: const [SpyDirective ])
21
+ class MyCounterComponent implements OnChanges {
22
22
@Input () num counter;
23
23
List <String > changeLog = [];
24
24
@@ -53,7 +53,7 @@ class MyCounter implements OnChanges {
53
53
</div>
54
54
''' ,
55
55
styles: const ['.parent {background: gold;}' ],
56
- directives: const [MyCounter ],
56
+ directives: const [MyCounterComponent ],
57
57
providers: const [LoggerService ])
58
58
class CounterParentComponent {
59
59
final LoggerService _logger;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import 'spy_directive.dart';
11
11
'.parent {background: khaki}' ,
12
12
'.heroes {background: LightYellow; padding: 0 8px}'
13
13
],
14
- directives: const [Spy ],
14
+ directives: const [SpyDirective ],
15
15
providers: const [LoggerService ])
16
16
class SpyParentComponent {
17
17
final LoggerService _logger;
@@ -31,7 +31,7 @@ class SpyParentComponent {
31
31
}
32
32
33
33
// removeHero(String hero) { } is not used.
34
-
34
+
35
35
void reset () {
36
36
_logger.log ('-- reset --' );
37
37
heroes.clear ();
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ int _nextId = 1;
9
9
// Spy on any element to which it is applied.
10
10
// Usage: <div mySpy>...</div>
11
11
@Directive (selector: '[mySpy]' )
12
- class Spy implements OnInit , OnDestroy {
12
+ class SpyDirective implements OnInit , OnDestroy {
13
13
final LoggerService _logger;
14
14
15
- Spy (this ._logger);
15
+ SpyDirective (this ._logger);
16
16
17
17
ngOnInit () => _logIt ('onInit' );
18
18
You can’t perform that action at this time.
0 commit comments