I use this function to view an array of objects for changes:
$scope.$watch('Data', function (newVal) { }, true);
How can I get the object in which the property was changed so that I can click it in an array? For example:
var myApp = angular.module("myApp", []); myApp.factory("Data", function(){ var Data = [{id:1, property: "Random"}, {id:2, property: "Random again"}]; return Data; }); var myBigArray = []; function tableCtrl($scope, Data){ $scope.TheData = Data; $scope.$watch("TheData", function() {
object angularjs get watch
CoolCodeBro Apr 20 '13 at 17:22 2013-04-20 17:22
source share