vlafranca / ngxautocomplace Goto Github PK
View Code? Open in Web Editor NEWGoogle Places Api Autocomplete Angular Directive
Google Places Api Autocomplete Angular Directive
Getting the following error when I run >> npm start
Error: node_modules/ngx-autocom-place/lib/ngx-autocom-place.service.d.ts:6:38 - error TS2694: Namespace 'google.maps.places' has no exported member 'AutocompleteSessionToken'.
6 sessionToken: google.maps.places.AutocompleteSessionToken;
I noticed that you're using the autoCompleteService not the Widget which is way better. However, when I checked your code I did not see that you're passing a sessionToken to the getPlacePredictions method.. it will be something like that..
// assume that this is a keyup event handler
if (userInput!== "") { service.getPlacePredictions({ input: value, sessionToken: sessionToken, types: ['geocode'] }, displaySuggestions); }
Where the session token is being initialized first and then injected on keydown or keyup even handler of the input element like this
let sessionToken = new google.maps.places.AutocompleteSessionToken();
The session token gets initialized every time the user makes a selection of the address.. using sessionTokens is the right way to implement the google autocomplete service because it will reduce the bill drastically.
Note that by default every time a user type in (assuming there is no debounce), it will generate a NEW sessionToken and inject it into the getPlacePredictions()
Please, correct me if I am wrong about anything
Thank you!
I'm trying to upgrade my project to angular 13, but I'm getting the following error every time I run npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: Project.de@2.0.2
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"^13.2.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^10.0.0" from ngx-autocom-place@4.0.0
npm ERR! node_modules/ngx-autocom-place
npm ERR! ngx-autocom-place@"^4.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
As it seems, this package is not supporting angular 13
Hi, I am using the ngxAutocomPlace library for autocomplete street addresses, Here when I am using the down keyword which is trowing the Cannot read properties of undefined (reading 'classList') error ,after selecting the street address
Is there any way to avoid the issue?
error-logging.service.ts:16 TypeError: Cannot read properties of undefined (reading 'classList') at NgxAutocomPlaceDirective.keydownEvent (:4200/vendor.js:171342:80) at HTMLInputElement.<anonymous> (:4200/vendor.js:171259:22) at ZoneDelegate.invokeTask (:4200/polyfills.js:11022:31) at Object.onInvokeTask (:4200/vendor.js:56311:33) at ZoneDelegate.invokeTask (:4200/polyfills.js:11021:60) at Zone.runTask (:4200/polyfills.js:10794:47) at ZoneTask.invokeTask [as invoke] (:4200/polyfills.js:11103:34) at invokeTask (:4200/polyfills.js:12216:14) at HTMLInputElement.globalZoneAwareCallback (:4200/polyfills.js:12242:17)
In angular NgxAutocomplace not supported the call back is not supported
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.