icon.component.ts 606 B

123456789101112131415161718192021
  1. import { Component, Input } from '@angular/core';
  2. @Component({
  3. selector: 'app-icon',
  4. templateUrl: './icon.component.html',
  5. styleUrls: ['./icon.component.scss'],
  6. })
  7. export class IconComponent {
  8. // private constructor() {
  9. // this.iconUrl = this.iconPrefix + this.icon + 'Damage.svg';
  10. // }
  11. @Input() public icon: string = '';
  12. @Input() public size: string = 'xs';
  13. @Input() public type: string = 'weapon';
  14. private weaponIconPrefix: string = 'assets/icons/damageIcons/';
  15. public iconUrl: string = '';
  16. ngOnChanges() {
  17. this.iconUrl = this.weaponIconPrefix + this.icon + '.svg';
  18. }
  19. }