I made the following code (jsFiddle) to get the input of a text field:
var app = angular.module('myApp', [
'my.controllers'
]);
var controllers = angular.module('my.controllers', []);
controllers.controller('MyController', function($scope) {
});
controllers.controller('listdata', function($scope, $http) {
$scope.editItem = function(event) {
var fieldTitle = $(event.currentTarget).attr("data-id");
var fieldValue = event.target.value;
console.log(fieldTitle + " : " + fieldValue);
};
})
In this case the function only returns the field name and field value of which the text is changed. What is the correct way to get all values of all input fields, when one of the fields is changed?