i am trying to use google places in ionic modal but not able to select the place.
see my plunker:
the main screen it’s working fine. i could able to search and select a location.
but when you open modal window by clicking the “Google Place” button, i am not able to select the address in the modal window. i am not getting the lat and long in modal window.
@Neethu its working but have a small issue that we have to tap 2nd time somewhere on the screen in-order to view the bind data.
Otherwise its working normally.
Thanks…
Got this working using this fix, but we don’t like using jQuery in our AngularJS applications so I changed it a bit to be within the AngularJS API with a bit of native JavaScript.
Markup
<input placeholder="Search for places"
ng-model="locationCtrl.event.location"
on-place-changed="locationCtrl.placeChanged()"
places-auto-complete
ng-focus="locationCtrl.disableTap($event)">
Controller
vm.disableTap = function(event) {
var input = event.target;
// Get the predictions element
var container = document.getElementsByClassName('pac-container');
container = angular.element(container);
// Apply css to ensure the container overlays the other elements, and
// events occur on the element not behind it
container.css('z-index', '5000');
container.css('pointer-events', 'auto');
// Disable ionic data tap
container.attr('data-tap-disabled', 'true');
// Leave the input field if a prediction is chosen
container.on('click', function(){
input.blur();
});
};