Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
スピナーのサービスクラス
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
You can’t perform that action at this time.