Angular Material icons not working

前端 未结 14 2186
走了就别回头了
走了就别回头了 2020-12-23 20:27

I\'ve installed Material for angular,

I\'ve imported on my app module MatIconModule (with import { MatIconModule } from \'@angular/material/icon\';)

14条回答
  •  [愿得一人]
    2020-12-23 20:59

    I realized no one spoke about installing hammerJs at first before importing it to your app. Well for people who have a similar issue you need to import hammerJs at first, you can use either NPM, Yarn or google CDN for the installation. This answer is for installation with either NPM or Yarn:

    NPM

    npm install --save hammerjs
    

    Yarn

    yarn add hammerjs
    
    

    After installing, import it on your app's entry point (e.g. src/main.ts).

    import 'hammerjs';
    

    If you prefer to use Google CDN kindly visit the Angular material for more explanation https://material.angular.io/guide/getting-started

提交回复
热议问题