Icon Component

agnusdei·2023년 7월 5일
0
post-custom-banner
<ion-icon [ngClass]="class" [src]="name ? 'https://api.iconify.design/' + name + '.svg' : src" />
import { CommonModule } from '@angular/common';
import { Component, HostBinding, Input, OnInit } from '@angular/core';
import { IonicModule } from '@ionic/angular'; // 필수

@Component({
  selector: 'app-icon',
  standalone: true, // 필수
  imports: [IonicModule, CommonModule], // 필수
  templateUrl: './icon.component.html',
  styleUrls: ['./icon.component.scss'],
})
export class IconComponent implements OnInit {

    @Input() name?: string | undefined;
    @Input() src?: string | undefined;
    @Input() class?: string | undefined;

    @HostBinding('class') _class = 'flex' // 필수
  constructor() { }

  ngOnInit() {}

}
post-custom-banner

0개의 댓글