Trying to watch a value in a config section of datatype. from another value.
The value being watched is a multivalue. refered to as docTypeAliases.
The custom value has this code to do the watching
$scope.$parent.$parent.$watch('preValues[0].value', function (e, args) {
var fString = '';
if (e != null) {
console.log(e)
angular.forEach(e, function (dt) {
fString = fString + dt.value + ","
});
$scope.ProfileList = undefined;
}
GetAvailableBlocks(fString);
$scope.loading = false;
});
The watch is triggered initally when creatinf or loading the dataType initally. But when a new value is added to the docTypeAliases value it never triggers.
Can any one surgest a better way.
I would normally setup an event trigger but as using umbraco default value editor I cant do that.
Further testing reveals that the trigger only gets triggered when I delete a value from docTypeAliases
AngularJs $watch only tiggering once
Trying to watch a value in a config section of datatype. from another value.
The value being watched is a multivalue. refered to as docTypeAliases.
The custom value has this code to do the watching
The watch is triggered initally when creatinf or loading the dataType initally. But when a new value is added to the docTypeAliases value it never triggers.
Can any one surgest a better way.
I would normally setup an event trigger but as using umbraco default value editor I cant do that.
Further testing reveals that the trigger only gets triggered when I delete a value from docTypeAliases
figured it out.
The watch dosent monitor the contents of the array.
Solution was to monitor the length
This now triggers everytime a value is added or deleted.
is working on a reply...