How to bind an AngularJS controller to dynamically added HTML?

后端 未结 6 612
清歌不尽
清歌不尽 2020-12-03 02:13

For this scenario, I have a page of HTML with some AngularJS directives, controllers, etc.

Something like this:



  
6条回答
  •  再見小時候
    2020-12-03 02:34

    I think ng-include might help you, it loads a partial page into the element and compiles and processes it like any other part of your web page.

    If This element is the main view of your web app, and you want to load different 'screens' into it, depending on the url, ng-view may come in handy.

提交回复
热议问题