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

后端 未结 1 351
南笙
南笙 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

    
    

    Demo: Plunker

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