@ -11,7 +11,7 @@ import {Component, ContentChildren, Directive, Input, QueryList} from '@angular/
|
||||
|
||||
@Directive({selector: 'pane'})
|
||||
export class Pane {
|
||||
@Input() id !: string;
|
||||
@Input() id!: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -22,8 +22,8 @@ export class Pane {
|
||||
`
|
||||
})
|
||||
export class Tab {
|
||||
@ContentChildren(Pane) topLevelPanes !: QueryList<Pane>;
|
||||
@ContentChildren(Pane, {descendants: true}) arbitraryNestedPanes !: QueryList<Pane>;
|
||||
@ContentChildren(Pane) topLevelPanes!: QueryList<Pane>;
|
||||
@ContentChildren(Pane, {descendants: true}) arbitraryNestedPanes!: QueryList<Pane>;
|
||||
|
||||
get serializedPanes(): string {
|
||||
return this.topLevelPanes ? this.topLevelPanes.map(p => p.id).join(', ') : '';
|
||||
@ -53,6 +53,8 @@ export class Tab {
|
||||
export class ContentChildrenComp {
|
||||
shouldShow = false;
|
||||
|
||||
show() { this.shouldShow = true; }
|
||||
show() {
|
||||
this.shouldShow = true;
|
||||
}
|
||||
}
|
||||
// #enddocregion
|
||||
|
@ -15,7 +15,7 @@ class ChildDirective {
|
||||
|
||||
@Directive({selector: 'someDir'})
|
||||
class SomeDir implements AfterContentInit {
|
||||
@ContentChildren(ChildDirective) contentChildren !: QueryList<ChildDirective>;
|
||||
@ContentChildren(ChildDirective) contentChildren!: QueryList<ChildDirective>;
|
||||
|
||||
ngAfterContentInit() {
|
||||
// contentChildren 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('contentChildren example', () => {
|
||||
|
Reference in New Issue
Block a user