本文整理汇总了TypeScript中@angular/core.ViewContainerRef.clear方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ViewContainerRef.clear方法的具体用法?TypeScript ViewContainerRef.clear怎么用?TypeScript ViewContainerRef.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core.ViewContainerRef
的用法示例。
在下文中一共展示了ViewContainerRef.clear方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
this.userProfileService.getUserProfileObserver().subscribe(data => {
if (this.userProfileService.hasRole(this.role)) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
this.viewContainer.clear();
}
});
示例2: loadComponent
loadComponent() {
this.entry.clear();
const className = this.getComponentName(this.contact.type);
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(contacts[className]);
this.componentRef = this.entry.createComponent(componentFactory, this.entry.length, null);
(this.componentRef.instance).contact = this.contact;
}
示例3: ngBookIf
@Input() set ngBookIf(condition) {
if (condition) {
this.viewContainer.createEmbeddedView(this.template);
} else {
this.viewContainer.clear();
}
}
示例4: ngOnInit
ngOnInit() {
if (this.platform.is('cordova')) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
this.viewContainer.clear();
}
}
示例5: fubar
@Input() set fubar(condition: boolean) {
if (!condition) {
this._viewContainer.createEmbeddedView(this._templateRef);
} else {
this._viewContainer.clear();
}
}
示例6: renderElementOnAuthenticated
renderElementOnAuthenticated(auth: Authentication) {
if (auth.token != null) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
this.viewContainer.clear();
}
}
示例7: mcIfWithBadge
@Input() set mcIfWithBadge(condition: boolean) {
if (condition) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
this.viewContainer.clear();
}
}
示例8: caShowContacts
@Input() set caShowContacts(numContacts: number) {
if (numContacts > 0) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
this.viewContainer.clear();
}
}
示例9: appHideElement
@Input() set appHideElement(condition: boolean) {
if (condition) {
this.viewContainer.clear();
} else {
this.viewContainer.createEmbeddedView(this.templateRef);
}
}
示例10: myUnless
// #enddocregion unless-constructor
// #docregion unless-set
@Input() set myUnless(condition: boolean) {
if (!condition) {
this.viewContainer.createEmbeddedView(this.templateRef);
} else {
this.viewContainer.clear();
}
}