Created
September 22, 2019 08:48
-
-
Save takuya-nakayasu/9142fa19e69264a5d6fa38be9edacbc8 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 { Injectable } from '@angular/core'; | |
import { Subject } from 'rxjs'; | |
/** | |
* スピナーの表示を制御するサービス | |
* | |
* @export | |
* @class SpinnerService | |
*/ | |
@Injectable() | |
export class SpinnerService { | |
public isLoading = new Subject<boolean>(); | |
constructor() {} | |
/** | |
* スピナーの表示 | |
* | |
* @memberof SpinnerService | |
*/ | |
public show(): void { | |
this.isLoading.next(true); | |
} | |
/** | |
* スピナーの非表示 | |
* | |
* @memberof SpinnerService | |
*/ | |
public hide(): void { | |
this.isLoading.next(false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment