-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for asynchronous map loading #60
Comments
+1, don't know about proposed promises solution, but I also load gmaps async. What to do? |
A solution might be to use the Google Maps SDK Async Loader.
When ready:
|
ruben has a direction.
then, in the controller do this:
and in order to avoid errors because the template with the ngAutocomplete directive is loaded before the uiGmapGoogleMapApi is resolved it should be wrapped in ng-if. (don't forget to save a ref to the $window on the scope on the link (or controller i guess) function of the directive where the ngAutocomplete directive is placed (ng-if matches only properties on the scope)
|
@thematan Your solution seems to be what I'm looking for but unfortunately it's not working to me... Could you help me ? Here my code, what dit I missed ? app.js :
controller :
directive :
view : ` But nothing shows up, and if I remove the ng-if, the "google is not defined" error appears. Thank you for your time ! |
@MathersMax
|
Hi ! Moving $rootscope.window = $window to .run() did the trick ! Thanks a lot. I'm facing a new issue that I can't figure out. The 'details' and 'ng-model' values are updated in the view but not in the controller. Do you know what to do ? Thanks you for your time ! |
@MathersMax how do you check for them to be changed ? |
I tried many ways :
of even with ng-change="showNameChanged()"
Here s the declaration of my autocomplete object :
and my view :
|
I finally find it by myself ! http://stackoverflow.com/questions/30818588/angularjs-model-not-updating-in-controller-scope Thanks for your time, I hope this will help ! |
I'm adding the map asynchronously, therefore I have the google is not defined error.
Can you do it with javascript promises ?
The text was updated successfully, but these errors were encountered: