Is there a way to add watch to a non scope variable. I want to add a watch to local variable. I have something like this
function EditAssetRegistryController(as
A cleaner syntax using ES6
$scope.$watch(() => { return this.thingToWatch; }, (newVal, oldVal) => { // Your code here... });