Skip to content Skip to sidebar Skip to footer

Angularjs Ng-repeat Is Not Working As Expected

I'm having a weird issue, I can access all the elements coming from my scope as data model, also I can see the scope elements in the Chrome console, but when I try using the model

Solution 1:

I removed the 'vm.' in your html and everything works as expected

<bodyng-controller="mainController"><divng-controller="app.views.layout.header as vm"><p>{{currentMenuName}} {{menu.items[0].displayName}} {{menu.items[1].displayName}}</p><ul><ling-repeat="menuItem in menu.items"><span>Not working! </span>{{menuItem.displayName}}
        </li></ul></div>

http://plnkr.co/edit/1BtC8p1ViqKXSbCWE3Kj?p=preview

Or you can us 'this' in your controller instead of $scope (see http://plnkr.co/edit/1BtC8p1ViqKXSbCWE3Kj?p=preview

Post a Comment for "Angularjs Ng-repeat Is Not Working As Expected"