angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

How can we select default option if some one does not select any option of auto complete

Open sudhirroy-tudip opened this issue 9 years ago • 6 comments

Issue description

Steps to reproduce and a minimal demo of the problem

_Use https://plnkr.co or similar -- try this template as a starting point: http://plnkr.co/edit/YX7W20?p=preview

What steps should we try in your demo to see the problem?

Current behavior

Expected/desired behavior

angular2 & angular-google-maps version

Other information

sudhirroy-tudip avatar Mar 22 '17 21:03 sudhirroy-tudip

Actually my problem is that if some one just copy and paste the actual address in auto complete search bar and then if he doesn't select any option, I want to set the first matching address in that field so I can get that position. I am using agmcoremodule in angular 2. Please help mr.

sudhirroy-tudip avatar Mar 22 '17 21:03 sudhirroy-tudip

Hi there,

Im not sure what you mean by 'they don't select an option' but could using ngOnChanges help?

code-by-nate avatar Mar 23 '17 03:03 code-by-nate

User is not selecting any option. He just wrote in text box and move forward to another field. In this case, I want to show the first option in text box. Also, there is any option to select any default option?

sudhirroy-tudip avatar Mar 23 '17 10:03 sudhirroy-tudip

Ok then I believe ngOnChanges will work for that. When value in text box has changed or in your case, the user has moved to the next field, onChanges will be called. From within that fiction, you can make a places API call to get lat/lng of address and set your map marker lat / lng to match. That's the basic idea anyways I think.

On 23 Mar 2017 8:00 pm, "sudhirroy-tudip" [email protected] wrote:

User is not selecting any option. He just wrote in text box and move forward to another field. In this case, I want to show the first option in text box.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SebastianM/angular2-google-maps/issues/949#issuecomment-288670645, or mute the thread https://github.com/notifications/unsubscribe-auth/AY4FmDYvOZ0Z1ygH502j2llBG2ZM4u32ks5rokLZgaJpZM4Ml20w .

code-by-nate avatar Mar 23 '17 21:03 code-by-nate

*function not fiction (:

On 24 Mar 2017 7:53 am, "Nathan Watson" [email protected] wrote:

Ok then I believe ngOnChanges will work for that. When value in text box has changed or in your case, the user has moved to the next field, onChanges will be called. From within that fiction, you can make a places API call to get lat/lng of address and set your map marker lat / lng to match. That's the basic idea anyways I think.

On 23 Mar 2017 8:00 pm, "sudhirroy-tudip" [email protected] wrote:

User is not selecting any option. He just wrote in text box and move forward to another field. In this case, I want to show the first option in text box.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SebastianM/angular2-google-maps/issues/949#issuecomment-288670645, or mute the thread https://github.com/notifications/unsubscribe-auth/AY4FmDYvOZ0Z1ygH502j2llBG2ZM4u32ks5rokLZgaJpZM4Ml20w .

code-by-nate avatar Mar 23 '17 21:03 code-by-nate

Autocomplete is not part of this project right now, so I'm closing this. Feel free to comment.

sebholstein avatar Mar 30 '17 19:03 sebholstein