etodanik / ion-google-place

Ionic directive for a location dropdown that utilizes google maps
MIT License
250 stars 201 forks source link

Using with multiple input boxes #86

Open Azmeer-crescent opened 8 years ago

Azmeer-crescent commented 8 years ago

Thanks for the fastest directive, but I try to use it with 2 inputs it only picks up one. I removed self closing to proper closing, still no luck.

<ion-google-place placeholder="Your starting place" ng-model="from"></ion-google-place>
<ion-google-place placeholder="Your destination" ng-model="to"></ion-google-place>
scrapex commented 8 years ago

I was having the same issue but added scope to the directive function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $document) { return { require: '?ngModel', restrict: 'E', scope: {//add scope so that it is different for each input placeInfo: '=info' }, and then added the place info in the html `

    </div>
    <div class="list list-inset">
      <ion-google-place placeholder="Enter an address, Apt# and ZIP" info="end" id="endLocation" ng-model="mainCtrl.endLocation" />
    </div>`

Seems to be working for now

exaland commented 7 years ago

Please help me ,

I need use this script with 2 textbox in same page and save the result of coordinate in Firebase

thanks for ur help