0

I am trying to use the md-icon in my app as per the documentation given here. However I am only able to get working with the type of syntax:

<i class="material-icons ng-scope">search</i>

The other usage type

<md-icon md-font-icon="search" alt="search"></md-icon>
<md-icon md-font-icon="icon-magnify" class="icon"></md-icon>

does not load anything.

I have already loaded the material fonts with

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

Though I can get the work done with the first syntax; I am interested to know what am I doing wrong that the second syntax is not working, while it should work perfectly as per the documentation.

user1242321
  • 1,578
  • 2
  • 18
  • 30

1 Answers1

1

Probably you are not loading them inside the correct element,

Here is a sample,

  <md-button aria-label="Search" type="submit">
  <md-icon md-font-icon="search">search</md-icon> 
  </md-button>

DEMO

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • Hey, Thanks for the reply. As per the documentation here https://material.angularjs.org/latest/api/directive/mdIcon , should wok fine, however ,it's not displaying anything even in your demo. One needs to mention the classname search between tags search to make it work, which was my original question. Is there something wrong with ? – user1242321 Oct 08 '16 at 06:18
  • Try this search – Sajeetharan Oct 08 '16 at 06:48
  • just search woks fine too, but this refers to the first way of doing things like i mentioned in the question. I was trying to get the "Use " form working as mentioned in the documentation i shared. But that is not working for me. :( – user1242321 Oct 08 '16 at 06:52
  • can you show a sample on the documentation where it works like you mentioned – Sajeetharan Oct 08 '16 at 07:03