本文整理匯總了TypeScript中@angular/core.ChangeDetectorRef類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ChangeDetectorRef類的具體用法?TypeScript ChangeDetectorRef怎麽用?TypeScript ChangeDetectorRef使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ChangeDetectorRef類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(c: ChangeDetectorRef, r: ElementRef) {
c.detach();
this.el = r.nativeElement;
}
示例2:
}).then(schema => {
this.toastrService.clear(loadingToaster.toastId);
this.schema = schema;
this.changeDetectorRef.markForCheck();
}).catch(error => {
示例3:
.subscribe(m => {
this.menu = m;
this._cdr.markForCheck();
});
示例4:
media.observe('(max-width: 599px)').subscribe( isMatched => {
this.isMediaSmall = isMatched.matches;
cdr.markForCheck();
});
示例5: setInterval
setInterval(() => {
// the following is required, otherwise the view will not be updated
this.ref.markForCheck();
}, 5000);
示例6:
this._intlSubscription = _intl.changes.subscribe(() => changeDetectorRef.markForCheck());
示例7: ngAfterViewInit
ngAfterViewInit() {
this.drawer = this.drawerComponent.sideDrawer;
this._changeDetectionRef.detectChanges();
}
示例8:
this.toolbar.stateChange.subscribe(editor => {
this.selected =
this.group.tools.find(option => option.select(editor.state)) || this.group
this.cdr.detectChanges()
})
示例9: setInterval
setInterval(() => {
this.ref.markForCheck();
}, 100);
示例10: ngOnDestroy
ngOnDestroy () {
this.chRef.detach();
}