icon src dynamic with Angular JS

  • Using angularjs to set the icon?

    <ons-list-item ng-repeat="item in menu" tappable>
            <ons-icon icon="{{item.icon}}"></ons-icon>

    I did so but did not work.

  • Hi @Luis-Guilherme-Pires-Moura - it should be doable.

    Have you tried inspecting it to see the result?

    Here’s a demo of your code working.

    If I remember correctly there might be a bug where an extra fa- may be added to the icon name. I think it’s been fixed on master, but we haven’t released in a while.

  • Thank guy realy is a double ‘fa-’ :sweat_smile:

Log in to reply