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.

how delete item or object array using ng-click?


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -