summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/components/customLoader/custom-loader.service.ts
diff options
context:
space:
mode:
authorYoav Schneiderman <yoav.schneiderman@intl.att.com>2020-01-15 15:32:10 +0200
committerEylon Malin <eylon.malin@intl.att.com>2020-01-20 13:16:47 +0000
commit3279721d72b3e5adadf5431c58383e71f6b080d7 (patch)
tree3b5fa47ab6a959dc66db1309d7a7308ab147a6b5 /vid-webpack-master/src/app/shared/components/customLoader/custom-loader.service.ts
parentdfcca5853eacb0e0d3bdd6370c724503c34194be (diff)
Move onap UI loader and icons to VID
Issue-ID: VID-748 Change-Id: If79180e55651ad29bd2771a35855209419d1a0f5 Signed-off-by: Yoav Schneiderman <yoav.schneiderman@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/components/customLoader/custom-loader.service.ts')
-rw-r--r--vid-webpack-master/src/app/shared/components/customLoader/custom-loader.service.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/components/customLoader/custom-loader.service.ts b/vid-webpack-master/src/app/shared/components/customLoader/custom-loader.service.ts
new file mode 100644
index 000000000..398eac233
--- /dev/null
+++ b/vid-webpack-master/src/app/shared/components/customLoader/custom-loader.service.ts
@@ -0,0 +1,34 @@
+import {Injectable} from "@angular/core";
+import {LoaderComponent} from "./custom-loader.component";
+
+@Injectable()
+export class LoaderService {
+
+ private mainLoaderName = 'general';
+ public registeredLoaders = {};
+
+ register(name: string, loader: LoaderComponent) {
+ if (!this.registeredLoaders[name]) {
+ this.registeredLoaders[name] = loader;
+ }
+ }
+
+ unregister(name: string) {
+ if (this.registeredLoaders[name]) {
+ delete this.registeredLoaders[name];
+ }
+ }
+
+ activate(name: string = this.mainLoaderName) {
+ if (this.registeredLoaders[name]) {
+ this.registeredLoaders[name].activate();
+ }
+ }
+
+ deactivate(name: string = this.mainLoaderName) {
+ if (this.registeredLoaders[name]) {
+ this.registeredLoaders[name].deactivate();
+ }
+ }
+
+}