Skip to content

Instantly share code, notes, and snippets.

@pascalwhoop
Last active March 17, 2017 10:43
Show Gist options
  • Save pascalwhoop/0baf89b40dd27f6df51701ba363a9f93 to your computer and use it in GitHub Desktop.
Save pascalwhoop/0baf89b40dd27f6df51701ba363a9f93 to your computer and use it in GitHub Desktop.
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