diff --git a/sharedComponents/pick-icon/pick-icon.component.html b/sharedComponents/pick-icon/pick-icon.component.html new file mode 100644 index 00000000..e1baf0cb --- /dev/null +++ b/sharedComponents/pick-icon/pick-icon.component.html @@ -0,0 +1 @@ +

pick-icon works!

diff --git a/sharedComponents/pick-icon/pick-icon.component.ts b/sharedComponents/pick-icon/pick-icon.component.ts new file mode 100644 index 00000000..f9881f1c --- /dev/null +++ b/sharedComponents/pick-icon/pick-icon.component.ts @@ -0,0 +1,21 @@ +import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Icon} from "../../utils/icons/icons"; +import {IconsService} from "../../utils/icons/icons.service"; + +@Component({ + selector: 'pick-icon', + templateUrl: './pick-icon.component.html' +}) +export class PickIconComponent implements OnInit, OnDestroy{ + customIcons: Icon[] = []; + + constructor(private iconService: IconsService) { + } + + ngOnInit() { + this.customIcons = this.iconService.getAll(); + } + + ngOnDestroy() { + } +} diff --git a/sharedComponents/pick-icon/pick-icon.module.ts b/sharedComponents/pick-icon/pick-icon.module.ts new file mode 100644 index 00000000..c85cf0b4 --- /dev/null +++ b/sharedComponents/pick-icon/pick-icon.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { PickIconComponent } from './pick-icon.component'; + + + +@NgModule({ + declarations: [ + PickIconComponent + ], + exports: [ + PickIconComponent + ], + imports: [ + CommonModule + ] +}) +export class PickIconModule { } diff --git a/utils/icons/icons.service.ts b/utils/icons/icons.service.ts index d6c84a83..d2f5c38b 100644 --- a/utils/icons/icons.service.ts +++ b/utils/icons/icons.service.ts @@ -1,8 +1,6 @@ import {Injectable} from "@angular/core"; -import {Icon} from "./icons"; import * as all from "./icons"; -import {Observable} from "rxjs"; -import {HttpClient} from "@angular/common/http"; +import {Icon} from "./icons"; @Injectable({ providedIn: 'root' @@ -11,7 +9,7 @@ export class IconsService { private registry = new Map(); - constructor(private http: HttpClient) { + constructor() { } public registerIcons(icons: any[]): void { @@ -22,10 +20,6 @@ export class IconsService { return this.registry.get(iconName); } - public getMaterialIcons(): Observable { - return this.http.get('https://fonts.google.com/metadata/icons'); - } - public getAll(): Icon[] { let icons: Icon[] = []; for (let key in all) { diff --git a/utils/theme/theme.component.html b/utils/theme/theme.component.html index bb6e9efd..c3192d3d 100644 --- a/utils/theme/theme.component.html +++ b/utils/theme/theme.component.html @@ -292,7 +292,7 @@
-
+