angular-leaflet-directive
angular-leaflet-directive copied to clipboard
How to use Angular modules with differents paramters in same single page application
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
On your HTML are you calling ng-app="app2" and ng-controller="BasicCenterController" ?
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 :)