How to delete item from array angularjs? -
why can't remove item array posts?
html tag delete item
html tag <span ng-click="remove($index)"> delete</span> //angularjs method try delete item blog.remove = function(index) { blog.posts.splice(index, 1); }; //angular array posts blog.posts = [{ "title": "blog post one", "comments": [ { "body":"lorem ipsum dolor sit amet, consectetur adipisicing elit. ", "author": "trollguy87" } ]}];
where can problem?
try passing item function , getting index item.
as mentioned in below thread.
Comments
Post a Comment