Skip to content

Instantly share code, notes, and snippets.

@takuya-nakayasu
Created September 22, 2019 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuya-nakayasu/9142fa19e69264a5d6fa38be9edacbc8 to your computer and use it in GitHub Desktop.
Save takuya-nakayasu/9142fa19e69264a5d6fa38be9edacbc8 to your computer and use it in GitHub Desktop.
スピナーのサービスクラス
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