material icon indicating copy to clipboard operation
material copied to clipboard

dynamic md-font-icon

Open NirAviel opened this issue 11 years ago • 6 comments

Hi, when adding md-font-icon attr as a scope param it doesn't render the icon (doesn't add the className to the element). same md-icon element, deferent icon name with every page of the app.

when navigating inside the app sometimes the previous page icon is rendered.

< md-icon md-font-icon="{{myIconName}}" >

NirAviel avatar Jun 09 '15 11:06 NirAviel

i can too confirm this behavior

vprenner avatar Jun 09 '15 17:06 vprenner

@NirAviel try using ng-class instead of md-font-icon. Here is an example using "font awesome"

<md-icon ng-class="{'fa': true, 'fa-circle': true}">

^ This is working for me, hope that helps...

rickycheers avatar Jun 16 '15 22:06 rickycheers

@NirAviel - md-font-icon and md-font-set are currently only supported as attributes with the following properties: 1x, read-only, non-dynamic attributes. @rickycheers - for your example, would <md-icon class="fa fa-circle"></md-icon> not be better?

ThomasBurleson avatar Jun 30 '15 16:06 ThomasBurleson

Thanks for the replies, I know how to make it work but I want it to work as it should and not go all over my app and change all the icons (wasn't on production yet so I had some time to wait but no more...).

NirAviel avatar Jul 01 '15 08:07 NirAviel

@ThomasBurleson thanks for the great work. Can you elaborate on the decision to make svg Icons dynamic (i.e. using observe/watch) but not font icons?

kugler avatar Jul 01 '15 08:07 kugler

Hello, I have started a project and I would like to use md-icon in a ng-repeat. please, could you give a light about it <tr ng-repeat="estudio in estudios_es"> <td>{{estudio.idestudio}}</td> <td><input type="text" ng-model="estudio.nomEstudio" /></td> <td>{{estudio.comentario}}</td> <td> <md-button class="md-icon-button" ng-click="editar_estudio(estudio, $index)"> <md-icon class="material-icons" aria-label="edit">mode_edit</md-icon> </md-button> </td> </tr> I would like that when I click on item, the icon changes and when I click on it again, this icon changes back again. These are two icons that I want to use: <md-icon class="material-icons" aria-label="edit">mode_edit</md-icon> <md-icon class="material-icons" aria-label="edit">done</md-icon> Thank you in advance for your help !!!!! josepfdc

josepfdc avatar Mar 29 '16 08:03 josepfdc