This may seem like a silly question, but I need to know how to view the entire DOM of the page and recompile it anytime. Essentially, this is what AngularJS does by default using data bindings, but I need this to happen at any time when something in the DOM has been changed, not just the bindings. The reason is because I have an application that is fully embedded in HTML, Javascript and PHP. This is a one-page application, it has a main page and embeds PHP in the DIV wrapper on this page.
I want to make some changes to it, but I want my code to be completely different from the source code. To do this, I need to be able to recompile the DOM at any time in a new PHP file into which the native DOM structure is entered. I still donβt work.
app.directive("watch", function () { return function (scope, element, attr) { scope.$watch("watch", function(oldValue, newValue) { if(newValue) { console.log("there is a new value"); console.log("the new value is " + newValue); } }); } });
I add the watch attribute with the <body> , but it does not work when the dom changes, nothing is logged. Ultimately, I would like to replace console.log with $ compilation, but first I need to get the clock to work. Can someone tell me what I'm doing wrong?
javascript dom angularjs
richbai90
source share