How to use in Angular Material?

后端 未结 9 606
南方客
南方客 2021-01-29 19:39

I was wondering how to use Material\'s icons, as this is not working:

          


        
相关标签:
9条回答
  • 2021-01-29 19:58

    All md- prefixes are now mat- prefixes as of time of writing this!

    Put this in your html head:

    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    

    Import in our module:

    import { MatIconModule } from '@angular/material';
    

    Use in your code:

    <mat-icon>face</mat-icon>
    

    Here is the latest documentation:

    https://material.angular.io/components/icon/overview

    0 讨论(0)
  • 2021-01-29 20:05
    <md-button class="md-fab md-primary" md-theme="cyan" aria-label="Profile">
        <md-icon icon="/img/icons/ic_people_24px.svg" style="width: 24px; height: 24px;"></md-icon>
    </md-button>
    

    source: https://material.angularjs.org/#/demo/material.components.button

    0 讨论(0)
  • 2021-01-29 20:07

    It actually works now from bower.

    bower install material-design-icons --save
    

    It downloads 37.1 KBs. Then it extracts and installs. You will see a folder called material-design-icons in bower_components folder. The total size is around 299KBs

    0 讨论(0)
提交回复
热议问题