akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.06k stars 1.51k forks source link

Error nbSpinner Keep loading !!! #880

Closed lukele1607 closed 6 years ago

lukele1607 commented 6 years ago

Issue description

Hi everyone, I use nbSpinner in parent-component: <nb-card [nbSpinner]="isLoading" nbSpinnerStatus="success"> .................

.................. (notify)="onChartNotify($event)">

In child-component.ts notify EventEmitter will return a boolean value: ............... @Output() notify: EventEmitter = new EventEmitter(); ............................. private generateToolBox() { return { orient: 'vertical', top: '5%', feature: { myTool1: { show: true, title: this.currentTranslations.Report, icon: ChartConstants.PortraitIcon, onclick: function () { this.api.getDom().value.generateReport(false); } } } } }; }

generateReport(isExtend: boolean): void {
    this.notify.emit(true);
    setTimeout(() => this.notify.emit(false), 3000);
}

In parent-component.ts, I handle event and set boolean value from child-component to isLoading: ................. isLoading: boolean; ................................... onChartNotify(message: boolean): void { this.isLoading = message; console.log(this.isLoading); }

But when notify emit(false) that mean isLoading in parent-component assigned by false, nbSpinner still keep loading on parent page unless I click on the parent page Please help me fix this problem !

Angular, Nebular

<!--
Check your `package-lock.json` or locate a `package.json` in the `node_modules` folder.
-->
lukele1607 commented 6 years ago

this problem is the View will not update after variable change. I fixed: