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

ngAutocomplete resets binded value #56

Open
sternshachar opened this issue Feb 26, 2015 · 3 comments
Open

ngAutocomplete resets binded value #56

sternshachar opened this issue Feb 26, 2015 · 3 comments

Comments

@sternshachar
Copy link

I have a city search with ng-autocomplete. When i want to edit my details it resets the city value on the scope to an empty string instead of taking the existing value.

any thoughts?

@adamclark64
Copy link

did you ever figure this out? I am currently in a similar situation trying to implement the simplest of trials

@sternshachar
Copy link
Author

I did solve it.
my ng-autocomplete directive is used in this way:

input type="text" id="Autocomplete" class="form-control" ng-autocomplete options="options" ng-model="home.city" details="details" style="color: black;"

in my controller:
$scope.options = {types: '(cities)'};
$scope.details = "";

I don't remember exactly why. Tell me if it didn't work and i'll dive more deep into it.

@adamclark64
Copy link

I solved my problem as well.. I simply wanted the address given by google
to become a string value for location.
in my scope i just took the input for a new location and gave it a value
equal to the 'result1" from the simple demo, before I added the property
value.. I think just a JS hack but thanks for getting back. I do see it
getting quite tricky when grabbing all the values this directive gives.
And thanks for being more responsive than the guy who made this that has
apparently dropped off the face off the planet, in terms of providing
answers to issues

On Sat, May 30, 2015 at 3:18 PM, sternshachar [email protected]
wrote:

I did solve it.
my ng-autocomplete directive is used in this way:

input type="text" id="Autocomplete" class="form-control" ng-autocomplete
options="options" ng-model="home.city" details="details" style="color:
black;"

in my controller:
$scope.options = {types: '(cities)'};
$scope.details = "";

I don't remember exactly why. Tell me if it didn't work and i'll dive more
deep into it.


Reply to this email directly or view it on GitHub
#56 (comment)
.

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

No branches or pull requests

2 participants