Closed gizburdt closed 8 years ago
Hi @gizburdt!
Do you mind creating an example of what you're trying to accomplish? Please follow the instructions here: http://help.angular-formly.com
This will make it easier for you to get help. Because the github issues are reserved for bug reports and feature requests, I'm going to go ahead and close this issue. See you on chat! Thanks!
@gizburdt Would't something like this be sufficient?
vm.map.addListener('center_changed', function(e){
c = vm.map.getCenter()
vm.model.latitude = c.latitude
vm.model.longitude = c.longitude
});
Thanks for the reply, will have a look at the instructions. I tries your example. vm.model is undefined
That's a suggestion, it's hard for me to guess your implementation. An example would be suitable to get help :smile:
Here is a stripped version (only relevant code) of my application: https://jsbin.com/rucifufotu/edit?html,js,output
Thanks :)
You are not even loading Angular. Please follow this template: new-example.angular-formly.com
Here is my the working example: https://jsbin.com/kanuhu/21/edit?console,output
So the thing I would like to achieve is when the center of the map changes, the input gets filled with the latitude/longitude.
Thanks :)
Sure no problem :smile:, you had many typos and basic mistakes regarding angular itself and angular-formly. I fixed some of them: https://jsbin.com/tuwuyo/1/edit?html,js,console,output
If you want me to explain them let me know in Gitter. See you on chat!
Hi, thnx for the help! I'm new to angular (& formly), so I try to learn as much as possible. Also new to Gitter, how can we start a chat?
Got it working in my own app. And I understand what you did, so Gitter isn't necessary anymore :). I understand the $scope.$apply(), and I made a typo in my model="", I had spot
, had to be vm.spot
, or vm.model
(add vm). Thanks again! :)
Np :smile:
Hi,
I'm working on an app with Google Maps. The thing I would like to do is, when the map center changes, set the latitude and longitude (both form fields).
I can listing on the center change, but how do I set the field value. How can I access the model property?
Hope my question is clear. Thanks :)