app.controller('indexController', ['$scope', 'authService', function ($scope, authService) {
var vm = this;
vm.$onInit = function () {
vm.active = {
"home": true,
"welcome": false,
"user": false,
"logout": false,
"login": false,
"signup":false
};
};
$scope.$watch('vm.active', function (newObj, oldObj) {
// How to detect which property has changed ?
}, true);
}]);
This way i tried, but i don't know how can i detect in watch(shown in my example code), which property has changed.