Created
January 24, 2017 10:30
-
-
Save tomasstankovic/e8f9b5b3e87784ae96e71c4338928bb2 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'; | |
@Injectable() | |
export class PreloaderService { | |
public static fullLoadingCount: number = 0; | |
public static smallLoadingCount: number = 0; | |
getPreloaderCount(preloaderType = 'full'): number { | |
if (preloaderType === 'full') { | |
return PreloaderService.fullLoadingCount; | |
} else if (preloaderType === 'small') { | |
return PreloaderService.smallLoadingCount; | |
} | |
} | |
showPreloader(preloaderType = 'full'): void { | |
if (preloaderType === 'full') { | |
PreloaderService.fullLoadingCount++; | |
} else if (preloaderType === 'small') { | |
PreloaderService.smallLoadingCount++; | |
} | |
} | |
hidePreloader(preloaderType = 'full'): void { | |
if (preloaderType === 'full') { | |
PreloaderService.fullLoadingCount--; | |
} else if (preloaderType === 'small') { | |
PreloaderService.smallLoadingCount--; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment