File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed
public/docs/_examples/lifecycle-hooks/dart Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class ChildComponent {
2020 <div>-- projected content begins --</div>
2121 <ng-content></ng-content>
2222 <div>-- projected content ends --</div>
23- <p *ngIf="comment != null " class="comment">{{comment}}</p>
23+ <p *ngIf="comment.isNotEmpty " class="comment">{{comment}}</p>
2424 '''
2525// #enddocregion template
2626 )
Original file line number Diff line number Diff line change @@ -22,16 +22,16 @@ class ChildViewComponent {
2222 <div>-- child view begins --</div>
2323 <my-child></my-child>
2424 <div>-- child view ends --</div>
25- <p *ngIf="comment != null " class="comment">{{comment}}</p>''' ,
25+ <p *ngIf="comment.isNotEmpty " class="comment">{{comment}}</p>''' ,
2626// #enddocregion template
2727 directives: const [ChildViewComponent ])
2828// #docregion hooks
2929class AfterViewComponent implements AfterViewChecked , AfterViewInit {
3030 var _prevHero = '' ;
31-
31+
3232 // Query for a VIEW child of type `ChildViewComponent`
3333 @ViewChild (ChildViewComponent ) ChildViewComponent viewChild;
34-
34+
3535// #enddocregion hooks
3636 final LoggerService _logger;
3737
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ import 'spy_directive.dart';
1717 styles: const [
1818 '.counter {background: LightYellow; padding: 8px; margin-top: 8px}'
1919 ],
20- directives: const [Spy ])
21- class MyCounter implements OnChanges {
20+ directives: const [SpyDirective ])
21+ class MyCounterComponent implements OnChanges {
2222 @Input () num counter;
2323 List <String > changeLog = [];
2424
@@ -53,7 +53,7 @@ class MyCounter implements OnChanges {
5353 </div>
5454 ''' ,
5555 styles: const ['.parent {background: gold;}' ],
56- directives: const [MyCounter ],
56+ directives: const [MyCounterComponent ],
5757 providers: const [LoggerService ])
5858class CounterParentComponent {
5959 final LoggerService _logger;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import 'spy_directive.dart';
1111 '.parent {background: khaki}' ,
1212 '.heroes {background: LightYellow; padding: 0 8px}'
1313 ],
14- directives: const [Spy ],
14+ directives: const [SpyDirective ],
1515 providers: const [LoggerService ])
1616class SpyParentComponent {
1717 final LoggerService _logger;
@@ -31,7 +31,7 @@ class SpyParentComponent {
3131 }
3232
3333 // removeHero(String hero) { } is not used.
34-
34+
3535 void reset () {
3636 _logger.log ('-- reset --' );
3737 heroes.clear ();
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ int _nextId = 1;
99// Spy on any element to which it is applied.
1010// Usage: <div mySpy>...</div>
1111@Directive (selector: '[mySpy]' )
12- class Spy implements OnInit , OnDestroy {
12+ class SpyDirective implements OnInit , OnDestroy {
1313 final LoggerService _logger;
1414
15- Spy (this ._logger);
15+ SpyDirective (this ._logger);
1616
1717 ngOnInit () => _logIt ('onInit' );
1818
You can’t perform that action at this time.
0 commit comments