Skip to content
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

How to use it from typescript #4

Open
psykolm22 opened this issue Dec 31, 2017 · 2 comments
Open

How to use it from typescript #4

psykolm22 opened this issue Dec 31, 2017 · 2 comments
Assignees

Comments

@psykolm22
Copy link
Owner

From @mmaryo on February 3, 2017 17:19

Hello,

I would like to use it from ts like :

let res = ng2GooglePlace.locate("15 rue de la république, Paris")

can you provide a service like that ?

Copied from original issue: psykolm22/ng2-google-place-autocomplete#7

@psykolm22
Copy link
Owner Author

Hello,

i can provide service like it, see usage below !

ng2GooglePlaceService.getPredictions("15 rue de la république, Paris").then((response) => {this.predictions = response})

For this example, this.predictions will be populate by some Google Place Predictions based on "15 rue de la république, Paris".

Google Place Predictions are not full detailled like Google Place but for get more details based on place_id from there results, i can also provide this :
ng2GooglePlaceService.getPlaceFromPlaceId(prediction).then((response) => {this.place = response})

If you have any suggestion please feel free to ask.

Ps: I just made an quick example of that usage in order to see possibilities , of course i let you imagine that finally example result can be parse like demo .

ng2-google-place-autocomplete

@psykolm22 psykolm22 self-assigned this Dec 31, 2017
@psykolm22
Copy link
Owner Author

From @mmaryo on February 14, 2017 17:18

thanks ! It's very good solution
(with typed response)

other thing, I would like to access to Address, Location, etc that are inside ng2-google-places.classes.ts, and dispite there classes are "export", I cannot use there in my code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant