本文整理匯總了TypeScript中ng2-toastr/ng2-toastr.ToastsManager.setRootViewContainerRef方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastsManager.setRootViewContainerRef方法的具體用法?TypeScript ToastsManager.setRootViewContainerRef怎麽用?TypeScript ToastsManager.setRootViewContainerRef使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng2-toastr/ng2-toastr.ToastsManager
的用法示例。
在下文中一共展示了ToastsManager.setRootViewContainerRef方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
public constructor(
viewContainerRef: ViewContainerRef,
// componentsHelper:ComponentsHelper,
private router: Router,
private authService: AuthService,
public toastr: ToastsManager) {
// You need this small hack in order to catch application root view container ref (ng2-bootstrap)
this.viewContainerRef = viewContainerRef;
// componentsHelper.setRootViewContainerRef(viewContainerRef);
this.toastr.setRootViewContainerRef(viewContainerRef); // hack for angular >= 2.2
}
示例2: constructor
constructor(
public elementRef: ElementRef,
public renderer: Renderer,
public router: Router,
public activatedRoute: ActivatedRoute,
public translate: TranslateService,
public toastr: ToastsManager,
public vcr: ViewContainerRef
) {
this.toastr.setRootViewContainerRef(vcr);
}
示例3: constructor
constructor(
public toastr: ToastsManager,
public vcr: ViewContainerRef
) {
this.toastr.setRootViewContainerRef(vcr);
}
示例4: constructor
constructor(private toastrService: ToastrService, private vcr: ViewContainerRef, private apiService: YoutubeApiService, private authService: AuthService) {
this.toastr = this.toastrService.manager();
this.toastr.setRootViewContainerRef(vcr);
}