Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit eda47f6

Browse files
chalinkwalrath
authored andcommitted
docs(guide/lifecycle-hooks): follow-up to #1654 (#1768)
Mainly Dart-side review, following #1654: - Updates to follow style guide - Enabled e2e tests - Fixes to ensure tests pass: in after_view_component.dart and after_content_component.dart - Changed test over comment field in template to be: *ngIf="comment.isNotEmpty" - Suites passed: public/docs/_examples/lifecycle-hooks/dart public/docs/_examples/lifecycle-hooks/ts
1 parent f06398c commit eda47f6

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

public/docs/_examples/lifecycle-hooks/dart/example-config.json

Whitespace-only changes.

public/docs/_examples/lifecycle-hooks/dart/lib/after_content_component.dart

+1-1
Original file line numberDiff line numberDiff 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
)

public/docs/_examples/lifecycle-hooks/dart/lib/after_view_component.dart

+3-3
Original file line numberDiff line numberDiff 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
2929
class 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

public/docs/_examples/lifecycle-hooks/dart/lib/counter_component.dart

+3-3
Original file line numberDiff line numberDiff 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])
5858
class CounterParentComponent {
5959
final LoggerService _logger;

public/docs/_examples/lifecycle-hooks/dart/lib/spy_component.dart

+2-2
Original file line numberDiff line numberDiff 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])
1616
class 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();

public/docs/_examples/lifecycle-hooks/dart/lib/spy_directive.dart

+2-2
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)