Giter Site home page Giter Site logo

Comments (3)

skynet2 avatar skynet2 commented on May 18, 2024

Hi @thari119 ,

There is a feature request on google for that https://issuetracker.google.com/issues/35823678

But looks like it`s closed as obsolete, because of new session-based billing for Places autocomplete. (last comment)

from ngx-google-places-autocomplete.

dkruchok avatar dkruchok commented on May 18, 2024

So maybe it's possible to control this with the library?
Something that can make it possible to prevent the request?
A simple example that doesn't work =)

            <input
                  matInput
                  placeholder="autocomplete"
                  formControlName="autocomplete"
                  (keyup)="onKey($event)"
                  ngx-google-places-autocomplete
                  #placesRef="ngx-places"
                  (onAddressChange)="handleAddressChange($event)"
                />
  onKey(event: Event) {
    if (this.form.controls.autocomplete.value.length < 4) {
      // stop API request
      event.stopImmediatePropagation();
      event.preventDefault();
      event.stopPropagation();
    }
  }

Would be great to have a method to stop request like this
@ViewChild('placesRef', { static: true }) placesRef: GooglePlaceDirective;

onKey(event: Event) {
    if (this.form.controls.autocomplete.value.length < 4) {
       this.placesRef.stop();
    }
}

from ngx-google-places-autocomplete.

harleenarora avatar harleenarora commented on May 18, 2024

any solution?

from ngx-google-places-autocomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.