Theme preview: Add inputs as fragment. Delete material icons from icons services

This commit is contained in:
Konstantinos Triantafyllou 2023-09-12 18:41:22 +03:00
parent 821c4242be
commit 11d0be4ffd
5 changed files with 43 additions and 9 deletions

View File

@ -0,0 +1 @@
<p>pick-icon works!</p>

View File

@ -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() {
}
}

View File

@ -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 { }

View File

@ -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<string, Icon>();
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<any> {
return this.http.get('https://fonts.google.com/metadata/icons');
}
public getAll(): Icon[] {
let icons: Icon[] = [];
for (let key in all) {

View File

@ -292,7 +292,7 @@
<hr class="uk-margin-large">
<div class="uk-grid-divider uk-grid" uk-grid="">
<div id="inputs" class="uk-grid-divider uk-grid" uk-grid="">
<div class="uk-width-3-5@m uk-first-column">
<div class="uk-child-width-expand@s uk-grid" uk-grid="">