I am trying to create page for add,delete,update the student elements dynamically. i've make a on json array element as data comportment it's will shown as table in view model.
User can able to delete or update the item from view model .for delete i've done with splice method it's working fine, for update an single element i need to bind with textbox ,select options dynamically
Here my templete and controller code
Please see attached for output screen thanks for your help
“If you’re good at something, never do it for free.” —The Joker
You should try avoid using jQuery ( Line no 7 ) for retrieval of values from the DOM, AngularJS does this binding for you. You can achieve this easily by adding ng-model directive to your text box and the dropdown. When the value in the dropdown or the text box is changed, the model value gets automatically updated.
Please note that I've added option attributes to the select box, you should also use the ng-selected directive to select the dropdown when you click on edit.
I've added a function editStudent on the scope and you can see I'm using the ng-click directive on the HTML. Please consider refactoring your variable names ( arr, ar should be replaced by meaningful names like students and student ).