-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
The following directive is wrong: (angular2-sample-code/5.built-in-directives/6.structural-directives/script.ts)
@Directive({
selector: '[ccFor]'
})
export class CodeCraftForOfDirective {
constructor(private templateRef: TemplateRef<any>,
private viewContainer: ViewContainerRef) {
}
@Input() set ccForOf(collection: any) {
if (condition) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
this.viewContainer.clear();
}
}
}
The condition boolean variable is not defined.
Metadata
Metadata
Assignees
Labels
No labels