Tuesday, 13 October 2015

How to Add and Remove items in array using AngularJS

With the help of Angularjs, We can dynamically add or remove list items in an array. It is shown In the example given below. Addition of the list items is done using 'push' method and removal of the item is done using “splice” method. Controller-

<div><input type="text" value="ItemName" placeholder="name of new item..." />
<button>Add Me</button>
<ul class="nav">
    <li id="item{{item.id}}"><a href="#">{{item.title}}</a> <a class="delete-item">x</a></li>
</ul>
</div>

'push' Method-

- Read the full Blog at: How to Add and Remove items in array using AngularJS.

Our Php developer forum forum is developed for those tech geeks who don’t want to wait for a longer duration of time, as the community members within FindNerd can answer any android query within shortest possible time frame.

Apart from this, If you have any language query like C, Java, JavaScript, iOS, Html, PHP etc . you can post at FindNerd’s Java questions and answers.

No comments:

Post a Comment