Browse Source

refactor(theme-shared): run detectChanges in isLoading setter

pull/4656/head
mehmet-erim 6 years ago
parent
commit
ac62b8cb07
  1. 16
      npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts

16
npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts

@ -24,14 +24,22 @@ import { filter } from 'rxjs/operators';
styleUrls: ['./loader-bar.component.scss'],
})
export class LoaderBarComponent implements OnDestroy, OnInit {
protected _isLoading: boolean;
@Input()
containerClass = 'abp-loader-bar';
set isLoading(value: boolean) {
this._isLoading = value;
this.cdRef.detectChanges();
}
get isLoading(): boolean {
return this._isLoading;
}
@Input()
color = '#77b6ff';
containerClass = 'abp-loader-bar';
@Input()
isLoading: boolean;
color = '#77b6ff';
progressLevel = 0;
@ -122,7 +130,7 @@ export class LoaderBarComponent implements OnDestroy, OnInit {
if (this.interval) this.interval.unsubscribe();
this.progressLevel = 100;
setTimeout(() => (this.isLoading = false), 0);
this.isLoading = false;
if (this.timer && !this.timer.closed) return;

Loading…
Cancel
Save