How to remove an item from an array in AngularJS scope?

后端 未结 10 1753
梦毁少年i
梦毁少年i 2020-11-27 09:10

Simple to-do list, but with a delete button on list page for each item:

Relevant template HTML:


          


        
10条回答
  •  时光说笑
    2020-11-27 09:51

    Angular have a built-in function called arrayRemove, in your case the method can simply be:

    arrayRemove($scope.persons, person)
    

提交回复
热议问题