I'm currently facing an issue with AngularJS. In my controller, I have a $watch setup like this:
function MyController() {
$watch('myModel', function() {
$rootScope.$emit('do-oper');
});
}
The value of 'myModel' is dynamically changing the DOM through binding.
Within a directive, I've defined the following event listener:
$rootScope.$on('do-oper', function() {
// Perform DOM manipulation here
});
However, when 'do-oper' is emitted, the DOM does not reflect the latest updates made to 'myModel'. Is there a way to ensure that the DOM manipulation occurs after the DOM has been fully rendered?