(The following messages, code snippets, etc, have been slightly altered for clarification)
The error message received is as follows:
Syntax Error: Token 'promiseObject' is unexpected, expecting [:] at column 3 of the expression [{{promiseObject?promiseObject.activeDEM:0}}] starting at [promiseObject?promiseObject.activeDEM:0}}].
The issue can be explained with the following code snippet:
Here is an example of the HTML being used:
<count-up id="feafdcds" duration="1" end-val='{{promiseObject?promiseObject.value:0}}' class="number" ></count-up>
The directive being utilized has an isolated scope. When the isolated scope is removed, the error disappears. However, without the isolated scope, monitoring attribute changes becomes a challenge.
angular.module('core-metronic').directive('countUp', ['$filter',
function ($filter) {
return {
restrict: 'E',
scope: {
endVal: '='
},
link: function ($scope, $el, $attrs) {
$scope.$watch('endVal',function(newValue,oldValue)
{
if(newValue)
alert(newValue);
},true);
//...additional code...
}
}
}
]);