Reputation: 3538
Another basic AngularJS question. I have two AngularJS apps, slider.js
(AngularUI) & json.js
.
slider.js
as a Plunkr.json.js
as a Plunkr.I want them both to run on a page. In fact, I want to use them together: I want to render sliders within my JSON renders. What is the best way to do this? This answer suggests creating a Main app & calling these both within it. Is that a good solution for when I want the functionality of both apps in the same place on the page, or should I be working on "combining" the apps- and how would one go about doing that?
My not-working attempt so far is here:
Upvotes: 0
Views: 2317
Reputation: 388436
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
Upvotes: 3