ion-google-place icon indicating copy to clipboard operation
ion-google-place copied to clipboard

Not working with Ionic 1.3.13

Open kevbaker opened this issue 9 years ago • 8 comments

I am trying to get ion-google-place working with Ionic 1.3.13.

After following the README instructions I am not seeing the location popup.

I am also not getting any errors.

Any idea on how to debug this?

kevbaker avatar Mar 06 '15 10:03 kevbaker

Did you include css to the head in index.html?

okonon avatar Mar 07 '15 00:03 okonon

Ok now I am getting the overlay which looks great, but I am unable to click on any of the items as I type. It is dynamically updating but not allowing me to tap on an item to close the modal.

kevbaker avatar Mar 09 '15 00:03 kevbaker

Digging into the ion-google-place code a bit more it seems like the selectLocation method on the popup scope is not being called.

I do have my <selectLocation> tag in a modal. I'll see if that is somehow related... perhaps a z-index issue?

kevbaker avatar Mar 09 '15 01:03 kevbaker

Yes that seems to be the problem. When I launch the ion-google-place popup from a non-ion-modal window it works perfectly.

Any thoughts on how to address this?

kevbaker avatar Mar 09 '15 01:03 kevbaker

Ah found the fix in another issue thread #4 Is there a reason this fix, adding the modal class to the ion-google-place-container, hasn't been merged?

kevbaker avatar Mar 09 '15 01:03 kevbaker

Create a quick pull request for this if you'd like to merge it.

kevbaker avatar Mar 09 '15 04:03 kevbaker

I struggled with getting the data out from the directive in the controller. My solution was to use a object in the ng-model

 <ion-google-place placeholder="Search City, Country" ng-model="search_data.location" > </ion-google-place>

in the controller

$scope.search_data = {
      location: ''
    };

$scope.$watch('search_data.location', function(newVal, oldVal) {
        console.log('watch', newVal, oldVal)
        if (newVal.hasOwnProperty('formatted_address')) {
            $scope.search_city();
        }
    }); 

exoer avatar Mar 26 '15 12:03 exoer

this worked for me. I used $scope.apply to assign the output to a variable.

seatechdev avatar Jun 19 '16 06:06 seatechdev