Issue with selected-object. Can you explain in more detail.
See original GitHub issueI’m running into unexpected behavior. My application is strictly CRUD based. When I set selected-object to the model scope in my products
controller, I run into an issue where angucomplete clears my input fields when updating records. I created an edit()
function which populates the input fields for a certain product. When I update the field which is an autocomplete field, it clears all of the input fields for that product.
I have partially worked around the issue by setting selected-object
to it’s own name. I can then assign it to my scope variable using something to the extent of:
$scope.product.client_id = $scope.clientAutocomplete.originalObject.id
and setting the initial-value
to {{ product.client_id }}
The problem with this method is if I don’t modify the autocomplete field on edit, I get the error that angucomplete object is undefined. It would be nice if setting initial-value
would create an object so this error isn’t encountered.
It would also be nice if further explanation on selected object
were given. It would be beneficial to explain this functionality for applications that create
and update
a lot of records.
P:S: Ghiden, your english is good, mine probably isn’t 😃
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top GitHub Comments
I used a watch on the output value. selected-object=“output” $scope.$watch(‘output’, function (val) { //do Somethig });