Open a-c-m opened 10 years ago
I've got a local branch that uses an onSelect
binding that will be called with the selected result
object as an argument. It looks something like this:
<angucomplete on-select="doSomethingWithSelected(result)" ... ></angucomplete>
# some Controller
$scope.doSomethingWithSelected = function(result) {
// Do something with the result object.
}
I'm going to make sure this is a usable, and desirable feature, and if so I'll open a Pull Request to add it. Would that help you?
Hi Steve,
It would mostly mask/work around the issue, more than fix it.
Its partly an ideological question, i'm not sure if what i've proposed is the "right" way or if there is a good reason why a wrapper/temp model is used.
+1
The docs compare selectedObject
to ngModel
so I expect a 2-way binding, and to be able to clear the input field if I clear what I expect to be the bound model but it does nothing
When testing this code i noticed you created a inner input element, with its own model then push the result into selectedObject when your ready.
This works, but means, for example if i wanted to clear the value shown, i would need to understand your naming convention (_value) and then tightly couple my code to this implementation.
Would you consider a patch that refactored so the original model is used, instead of a wrapper model?