-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
options not working with Angular 11 #91
Comments
It is typescript error try this
|
add ? within all items of Options class in options.d.ts file from 'node_modules/ngx-google-places-autocomplete/objects/options/options' folder.
It's worked for me! |
The following works for me: component.html
component.ts
|
I tried like this and it worked for me component : |
I don't think this is the right approach |
highly discourage this because there's rarely a situation where it's ok to edit source files. node files aren't usually committed to a repo (file size is large and only needs to be on your computer so they're usually excluded - see .gitignore file) so if another person pulls the repo, they will not have the changes you made to the source file |
Use this:
There are two changes:
|
But why can it only be a string? Google places accept an array for up to 5 countries. |
trying to add place autocomplete in my Angular 11 web app it works fine without options but while trying to add options it throws error, following are the details
component :
**
<input ngx-google-places-autocomplete [options]='options' #placesRef="ngx-places" (onAddressChange)="handleAddressChange($event)"/>
**
my options object:
**
options = {
types: ['address'],
componentRestrictions: { country: ['ca', 'us'] }
};
**
after adding options it throws error
** error TS2739: Type '{ types: string[]; componentRestrictions: { country: string[]; }; }' is missing the followin
g properties from type 'Options': bounds, fields, strictBounds, origin **
I tried adding other options but it keeps on asking for more n more options
The text was updated successfully, but these errors were encountered: