Skip to content
This repository has been archived by the owner on Dec 31, 2017. It is now read-only.

How to use it from typescript #7

Closed
mmaryo opened this issue Feb 3, 2017 · 3 comments
Closed

How to use it from typescript #7

mmaryo opened this issue Feb 3, 2017 · 3 comments
Assignees

Comments

@mmaryo
Copy link

mmaryo commented Feb 3, 2017

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 ?

@psykolm22
Copy link
Owner

psykolm22 commented Feb 13, 2017

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 Feb 13, 2017
@mmaryo
Copy link
Author

mmaryo commented Feb 14, 2017

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

@psykolm22
Copy link
Owner

This issue was moved to psykolm22/angular-google-place#4

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

No branches or pull requests

2 participants