I have an array of objects with names displayed in input fields. I want to update the corresponding object with whatever the user fills in the input field when they click the button.
For example, if I enter “abcde” and “pq” in the input fields, the updated object should be displayed on button click.
[
{
name:'abcde’
},
{
name:'pq'
}
];
http://plnkr.co/edit/51BlTe5tAEgMV7ZlJLKV
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
$scope.c = [
{
name:'abc'
},
{
name:'pqr'
}
];
$scope.onclick =function(){
alert('dd')
console.log($scope.c)
}
});