Skip to content

Commit 58008db

Browse files
authored
Merge pull request allenhwkim#836 from dvelasquez/patch-1
Fix heatmap-layer.js nested prop
2 parents db3d95d + 90064be commit 58008db

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

directives/heatmap-layer.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* set options
3232
*/
3333
var options = parser.getOptions(filtered, {scope: scope});
34-
options.data = $window[attrs.data] || scope[attrs.data];
34+
options.data = $window[attrs.data] || parseScope(attrs.data, scope);
3535
if (options.data instanceof Array) {
3636
options.data = new google.maps.MVCArray(options.data);
3737
} else {
@@ -46,6 +46,13 @@
4646
console.log('heatmap-layer options', layer, 'events', events);
4747

4848
mapController.addObject('heatmapLayers', layer);
49+
50+
//helper get nexted path
51+
function parseScope( path, obj ) {
52+
return path.split('.').reduce( function( prev, curr ) {
53+
return prev[curr];
54+
}, obj || this );
55+
}
4956
}
5057
}; // return
5158
}]);

0 commit comments

Comments
 (0)