本文整理汇总了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();
}