Let's say I have:
directives.directive('foo', function () {
return {
restrict:'A',
scope: true,
link:function (scope, element, attr) {
console.log('innerHTML is ' + element.innerHTML);
scope.$watch('update', function (newValue) {
console.log('innerHTML is... ' + element.innerHTML);
});
}
}
});
... then innerHTML is undefined. I imagine this is due to the way Angular processes the DOM. What is the right way to obtain the innerHTML?