@ -11,7 +11,7 @@ import {Component, ContentChild, Directive, Input} from '@angular/core';
|
||||
|
||||
@Directive({selector: 'pane'})
|
||||
export class Pane {
|
||||
@Input() id !: string;
|
||||
@Input() id!: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -21,7 +21,7 @@ export class Pane {
|
||||
`
|
||||
})
|
||||
export class Tab {
|
||||
@ContentChild(Pane) pane !: Pane;
|
||||
@ContentChild(Pane) pane!: Pane;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -38,6 +38,8 @@ export class Tab {
|
||||
export class ContentChildComp {
|
||||
shouldShow = true;
|
||||
|
||||
toggle() { this.shouldShow = !this.shouldShow; }
|
||||
toggle() {
|
||||
this.shouldShow = !this.shouldShow;
|
||||
}
|
||||
}
|
||||
// #enddocregion
|
||||
|
@ -15,7 +15,7 @@ class ChildDirective {
|
||||
|
||||
@Directive({selector: 'someDir'})
|
||||
class SomeDir implements AfterContentInit {
|
||||
@ContentChild(ChildDirective) contentChild !: ChildDirective;
|
||||
@ContentChild(ChildDirective) contentChild!: ChildDirective;
|
||||
|
||||
ngAfterContentInit() {
|
||||
// contentChild is set
|
||||
|
@ -6,7 +6,8 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ElementFinder, browser, by, element} from 'protractor';
|
||||
import {browser, by, element, ElementFinder} from 'protractor';
|
||||
|
||||
import {verifyNoBrowserErrors} from '../../../../../test-utils';
|
||||
|
||||
describe('contentChild example', () => {
|
||||
|
Reference in New Issue
Block a user