Wednesday, 15 January 2014

javascript - Dynamically updating array ng-repeat -



javascript - Dynamically updating array ng-repeat -

i new angular , have built controller angular shown in below.

var app = angular.module('jobs', []); app.controller('dactrl',function(){ this.itemlist = [{id:"001"},{id:"002"},{id:"003"}]; });

what need update "itemlist" property dynamically calling function , display items using ng-repeat tried , didnt work :(

what have tried far jsfiddle

updated fiddle

you're there! looks need set itemslist $scope variable, it'll available in template.

since you're beginner, recommend putting on $scope variable know accessible in template , in javascript, no matter what.

here's jsfiddle working solution (everything on $scope): http://jsfiddle.net/pprkng7o/25/

javascript angularjs

No comments:

Post a Comment