How do I combine two AngularJS apps as modules of a main app?

后端 未结 1 341
南笙
南笙 2021-01-17 06:47

Another basic AngularJS question. I have two AngularJS apps, slider.js (AngularUI) & json.js.

Here\'s slider.js as a Plunkr.

H

相关标签:
1条回答
  • 2021-01-17 07:26

    You need to add the slider as dependent of myapp then use myapp in the page declaration, so that myApp will have all elements(directives/controllers/filters etc) added in slider app also.

    var myApp = angular.module('myApp', ['ui.slider']);
    

    then

    <html ng-app="myApp">
    

    Demo: Plunker

    0 讨论(0)
提交回复
热议问题