app.config(function ($routeProvider) { $routeProvider.when('/map', { template: '', controller: 'BasicDynamicAddRemoveMapExample' }); }); app.controller('BasicDynamicAddRemoveMapExample', [ '$scope', 'leafletData', function($scope, leafletData) { } ]);