Last active
March 17, 2017 10:43
-
-
Save pascalwhoop/0baf89b40dd27f6df51701ba363a9f93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, OnInit, OnDestroy} from "@angular/core"; | |
import {LoadingEventListener} from "../../services/LoadingEventListener"; | |
import {VFeedbackService} from "../../services/vfeedback.service"; | |
import {_keyValueDiffersFactory} from "@angular/core/src/application_module"; | |
@Component({ | |
selector: 'app-working-spinner', | |
template: `<md-progress-spinner mode="indeterminate" *ngIf="_visible">`, | |
styleUrls: ['working-spinner.component.scss'] | |
}) | |
export class WorkingSpinnerComponent extends LoadingEventListener implements OnInit, OnDestroy { | |
private _visible: boolean; | |
constructor(public vfeedbackService: VFeedbackService) { | |
super(); | |
} | |
onLoading() { | |
this._visible = true; | |
} | |
onLoadingComplete() { | |
this._visible = false; | |
} | |
ngOnInit() { | |
this.vfeedbackService.addListener(this); | |
} | |
ngOnDestroy(): void { | |
this.vfeedbackService.removeListener(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment