node.js - AngularJs/Nodejs updating view and animating it -
i'm writing
angularjs/nodejs
i useed $http service load data database , ngrepeat directive display view. can't when add new item database, update view 1 item, , animation.i know need use nganiamte , set class on ng enter how push single item data array without reloading whole view?
data load , insert
vm.loaddata = function () { $http.get('/data') .success(function (data) { vm.data = data; }) .error(function (data) { console.log('error: ' + data); }); } http.post('/data', data).success(function (data) { })
i assume vm.data
array? should not reassign complete array rather add new items it, delete old items and/or update items in it. can add new items vm.data.push()
, add/delete items vm.data.splice()
. this, need compare vm.data
data
determine items need added/deleted/modified.
Comments
Post a Comment