-
Notifications
You must be signed in to change notification settings - Fork 166
Description
Hello everyone,
I am new to angulrJs and right now I am trying to using this directive in my ionic app. I am trying to get the results of the map to save in to my database via the controller, so I tried ng-model, but it is undefined. I saw many people say that using watch might be a good option, but I am not sure how to use it.
Additionally, I want to get the lat and long of a address, I know how to make it show up in html, {{ng-model-var.geometry.location.lat()}}, but I don't know how to save it.
Here is my HTML
<input ng-autocomplete type="text" ng-model="location" details="details" options="options">
Here is what I attempt to do in controller.
$scope.$watch('details', function(location) {
var formattedLocation = ($scope.location);
console.log(formattedLocation);
});
Thank you so much! Any help would be really appreciated it since I have been stuck for so long..