I do have two $scope
variables. They are called $scope.image
and $scope.titleimage
.
Basically the store the same type of contents.
The correct answer was found here:
https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$watchCollection
"for arrays, this implies watching the array items; for object maps, this implies watching the properties"
Example:
$scope.$watchCollection(function () {
return {t : ctrl.time, d : ctrl.date};
}, function(value) {
ctrl.updateDateTime();
});