javascript - load json data into li with ng-repeat -


i can't load data list ng-repeat, here's app

http://plnkr.co/edit/dd05tnnlg66h6nklbjhm?p=preview

in line 12 of app.js wrote

$scope.tabs = tabs; 

which tabs object in data.js

one strange thing occur too, when console.log in maincontroller scope, tend execute twice. wonder

you're using $scope.tabs.push add data tabs. can't because $scope.tabs object , not array. change data.js :

var tabs = [     {         'tabid':1,         'tabname': 'main',         'tabfriends':[             {'name':'someone1'},             {'name':'someone1'},         ]     },     {         'tabid':2,         'tabname': 'programming',         'tabfriends':[             {'name':'someone2'}         ]     } ]; 

it's array, can push now. , angularjs happy repeat on it.

and tab object has tabname property, while on addtab function call name.


Comments

Popular posts from this blog

php - How to serve a file for download on WordPress -

how to share virtual sharepoint server and get it in host windows and visual studio? -