We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d22db1e + e166601 commit 3e508bdCopy full SHA for 3e508bd
controllers/map-controller.js
@@ -231,7 +231,14 @@
231
vm.eventListeners = {};
232
233
if (options.lazyInit) { // allows controlled initialization
234
- vm.map = {id: $attrs.id}; //set empty, not real, map
+ // parse angular expression for dynamic ids
235
+ if (!!$attrs.id && $attrs.id.startsWith('{{') && $attrs.id.endsWith('}}')) {
236
+ var idExpression = $attrs.id.slice(2,-2);
237
+ var mapId = $parse(idExpression)($scope);
238
+ } else {
239
+ var mapId = $attrs.id;
240
+ }
241
+ vm.map = {id: mapId}; //set empty, not real, map
242
NgMap.addMap(vm);
243
} else {
244
vm.initializeMap();
0 commit comments