How should I load mvc partial views and keep Angular JS working. Angular JS is working fine after I render the layout, but if I load partial views in the layout, Angular JS is not working anymore in the partials. I guess that Angular engine is not compiling the ng- directives after I inject the HTML in the DOM.
Instead of inject your HTML manually. Be it through angular.element.html or $().html. Try using one of the following, angular approved, options:
Because these are AngularJS friendly methods, Angular will actually parse the HTML and bind any values within the newly loaded HTML.
From an answer from here
I think you may need to compile HTML string or DOM into a template.
More information, please refer to:
There are some threads that may help you:
©2020 All rights reserved.