AngularJS Multiple ng-app within a page

后端 未结 13 2202
闹比i
闹比i 2020-11-22 01:48

I have just started learning Angular JS and created some basic samples however I am stuck with the following problem.

I have created 2 modules and 2 controllers.

13条回答
  •  情深已故
    2020-11-22 02:23

    In my case I had to wrap the bootstrapping of my second app in angular.element(document).ready for it to work:

    angular.element(document).ready(function() {
      angular.bootstrap(document.getElementById("app2"), ["app2"]);
    });   
    

提交回复
热议问题