docs: api doc cleanup (#31377)

PR Close #31377
This commit is contained in:
Judy Bogart
2019-07-01 12:31:42 -07:00
committed by Jason Aden
parent 35f8bfce8b
commit 40aaa42f44
18 changed files with 184 additions and 210 deletions

View File

@ -11,18 +11,16 @@ import {Component, ContentChild, Directive, Input} from '@angular/core';
@Directive({selector: 'pane'})
export class Pane {
// TODO(issue/24571): remove '!'.
@Input() id !: string;
}
@Component({
selector: 'tab',
template: `
<div>pane: {{pane?.id}}</div>
<div>pane: {{pane?.id}}</div>
`
})
export class Tab {
// TODO(issue/24571): remove '!'.
@ContentChild(Pane, {static: false}) pane !: Pane;
}
@ -33,7 +31,7 @@ export class Tab {
<pane id="1" *ngIf="shouldShow"></pane>
<pane id="2" *ngIf="!shouldShow"></pane>
</tab>
<button (click)="toggle()">Toggle</button>
`,
})

View File

@ -11,14 +11,13 @@ import {Component, ContentChildren, Directive, Input, QueryList} from '@angular/
@Directive({selector: 'pane'})
export class Pane {
// TODO(issue/24571): remove '!'.
@Input() id !: string;
}
@Component({
selector: 'tab',
template: `
<div class="top-level">Top level panes: {{serializedPanes}}</div>
<div class="top-level">Top level panes: {{serializedPanes}}</div>
<div class="nested">Arbitrary nested panes: {{serializedNestedPanes}}</div>
`
})
@ -47,7 +46,7 @@ export class Tab {
</tab>
</pane>
</tab>
<button (click)="show()">Show 3</button>
`,
})

View File

@ -15,7 +15,6 @@ class ChildDirective {
@Directive({selector: 'someDir'})
class SomeDir implements AfterContentInit {
// TODO(issue/24571): remove '!'.
@ContentChildren(ChildDirective) contentChildren !: QueryList<ChildDirective>;
ngAfterContentInit() {

View File

@ -55,9 +55,7 @@ import {Injectable, InjectionToken, Injector, Optional, ReflectiveInjector} from
describe('ClassProvider', () => {
it('works', () => {
// #docregion ClassProvider
abstract class Shape { // TODO(issue/24571): remove '!'.
name !: string;
}
abstract class Shape { name !: string; }
class Square extends Shape {
name = 'square';
@ -94,9 +92,7 @@ import {Injectable, InjectionToken, Injector, Optional, ReflectiveInjector} from
describe('StaticClassProvider', () => {
it('works', () => {
// #docregion StaticClassProvider
abstract class Shape { // TODO(issue/24571): remove '!'.
name !: string;
}
abstract class Shape { name !: string; }
class Square extends Shape {
name = 'square';

View File

@ -11,7 +11,6 @@ import {Component, Directive, Input, ViewChild} from '@angular/core';
@Directive({selector: 'pane'})
export class Pane {
// TODO(issue/24571): remove '!'.
@Input() id !: string;
}
@ -20,10 +19,10 @@ export class Pane {
template: `
<pane id="1" *ngIf="shouldShow"></pane>
<pane id="2" *ngIf="!shouldShow"></pane>
<button (click)="toggle()">Toggle</button>
<div>Selected: {{selectedPane}}</div>
<div>Selected: {{selectedPane}}</div>
`,
})
export class ViewChildComp {

View File

@ -15,7 +15,6 @@ class ChildDirective {
@Component({selector: 'someCmp', templateUrl: 'someCmp.html'})
class SomeCmp implements AfterViewInit {
// TODO(issue/24571): remove '!'.
@ViewChild(ChildDirective, {static: false}) child !: ChildDirective;
ngAfterViewInit() {

View File

@ -11,7 +11,6 @@ import {AfterViewInit, Component, Directive, Input, QueryList, ViewChildren} fro
@Directive({selector: 'pane'})
export class Pane {
// TODO(issue/24571): remove '!'.
@Input() id !: string;
}
@ -21,14 +20,13 @@ export class Pane {
<pane id="1"></pane>
<pane id="2"></pane>
<pane id="3" *ngIf="shouldShow"></pane>
<button (click)="show()">Show 3</button>
<div>panes: {{serializedPanes}}</div>
<div>panes: {{serializedPanes}}</div>
`,
})
export class ViewChildrenComp implements AfterViewInit {
// TODO(issue/24571): remove '!'.
@ViewChildren(Pane) panes !: QueryList<Pane>;
serializedPanes: string = '';

View File

@ -15,7 +15,6 @@ class ChildDirective {
@Component({selector: 'someCmp', templateUrl: 'someCmp.html'})
class SomeCmp implements AfterViewInit {
// TODO(issue/24571): remove '!'.
@ViewChildren(ChildDirective) viewChildren !: QueryList<ChildDirective>;
ngAfterViewInit() {