This is ideal for some of my projects, but I do have a small complain. Except if I am blind, I didn't see any way to call map before being initialized (which is a major drawback for random anync operations). When I say before I mean of course through a promise. So I had to create a Service that looks like this
...
var _map = $q.defer();
var _private = {
getMap: function () {
return _map.promise;
}
};
return {
getMap: function () {
return _private.getMap();
},
setMap: function (map) {
_map.resolve(map);
}
}
...
the map is set inside the on-map-initialized function
model.customise = function (map) {
mapService.setMap(map);
};
and It is used like this
ServiceName.getMap().then(function (map) {
});
If I find a bit of spare time I might end up doing a pull request
This is ideal for some of my projects, but I do have a small complain. Except if I am blind, I didn't see any way to call map before being initialized (which is a major drawback for random anync operations). When I say before I mean of course through a promise. So I had to create a Service that looks like this
the map is set inside the on-map-initialized function
and It is used like this
If I find a bit of spare time I might end up doing a pull request