Optmize
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { MD2Icon, TreasureType } from '../massive-darkness2.model';
|
||||
import { MD2StateService } from '../../../services/MD2/md2-state.service';
|
||||
import { MD2Service } from '../../../services/MD2/md2.service';
|
||||
|
||||
@Component({
|
||||
selector: 'md2-icon',
|
||||
@@ -44,7 +44,7 @@ export class MD2IconComponent implements OnInit {
|
||||
}
|
||||
@Input() size: string = 'sm';
|
||||
iconName: string;
|
||||
constructor(private md2StateService: MD2StateService) { }
|
||||
constructor(private md2Service: MD2Service) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
@@ -52,10 +52,10 @@ export class MD2IconComponent implements OnInit {
|
||||
private initIcon(icon: MD2Icon): void {
|
||||
if (icon < MD2Icon.TreasureToken) {
|
||||
this.isImageIcon = false;
|
||||
this.iconHtml = this.md2StateService.iconHtml(icon);
|
||||
this.iconHtml = this.md2Service.iconHtml(icon);
|
||||
} else {
|
||||
this.isImageIcon = true;
|
||||
this.imgUrl = this.md2StateService.iconHtml(icon);
|
||||
this.imgUrl = this.md2Service.iconHtml(icon);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user