angular-leaflet-directive icon indicating copy to clipboard operation
angular-leaflet-directive copied to clipboard

How to use Angular modules with differents paramters in same single page application

Open marie15 opened this issue 8 years ago • 2 comments

Hello everyone, I'm using AngularJS in my single page application, I have to use diiferents angular modules. I declared one module like that: var app1 = angular.module('Myapp1',[]); app1.controller('MainCtrl', function($scope) { ...} And I want to use the second one with this paramter which is leaflet directive: var app2 = angular.module('Myapp2', ['leaflet-directive']); app2.controller('BasicCenterController', [ '$scope', function($scope) { ....} But when I approach like that the map not appear, that's mean the seconf module didn't work. Did you have any idea how to fix it? Thankx for advance

marie15 avatar Apr 10 '16 15:04 marie15

On your HTML are you calling ng-app="app2" and ng-controller="BasicCenterController" ?

drewmo avatar Apr 11 '16 18:04 drewmo

Hi, yes. I found a solution right now, I combined the two modules by adding this line: angular.module("CombineModule", ["Myapp1", "Myapp2"]). But thank you so much for your time :)

marie15 avatar Apr 11 '16 20:04 marie15