Font Awesome 5 with Angular

后端 未结 3 501
不思量自难忘°
不思量自难忘° 2020-12-01 01:59

How do I use font-awesome 5 with Angular (2+)?

I\'ve tried adding this inside a component:

import {faChevronLe         


        
3条回答
  •  星月不相逢
    2020-12-01 02:34

    I am using Font Awesome 5 in Angular

    This is HTML code

     Star 
    

    This is my Component

    import { Component, OnInit } from '@angular/core';
    
    @Component({
      selector: 'favorite',
      templateUrl: './favorite.component.html',
      styleUrls: ['./favorite.component.css']
    })
    export class FavoriteComponent implements OnInit {
    isFavorite: boolean;
      prefix:string;
      constructor() { }    
      ngOnInit() { }
    
      onClick(){
        this.isFavorite = !this.isFavorite;    
      }
    }
    `
    

提交回复
热议问题