Using ng as a framework, I found a problem when routing. It doesn't work when different pages use different js. I know the reason is that your js needs to get some Dom nodes. But when the homepage is first loaded, my page is not loaded. At this time, these DOM nodes cannot be obtained. Do you have any good solutions?
The DOM event cannot take effect. There is a live method (jquery on). If the double binding of data fails, $scope.$apply() is manually refreshed. The loading of the DOM node is also related to the location where your js is written. Your question is not clear enough
A frequently used method, use the
$timeout
method:angular.element(document).ready()
Put js in ready and try it
This problem has been solved. I also encountered it before and struggled with it for a long time. http://www.weipxiu.com/?p=434