question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with selected-object. Can you explain in more detail.

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
UndefinedOnGitHubcommented, Aug 31, 2015

I used a watch on the output value. selected-object=“output” $scope.$watch(‘output’, function (val) { //do Somethig });

1reaction
Boshencommented, Mar 31, 2015
Attribute Description Required Example
clear-selected To clear out input field upon selecting an item, set this attribute to true. example No true
Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting selected object not working - DevForum | Roblox
First, try printing a string right after the if statement, for it may be your condition. I also usually have problems with UserInputService...
Read more >
Wierd behavior of list items and selected object pairing - Support ...
First of all I'm really upset that we have wierd mapping of Display = value and Value ... We are currently investigating this...
Read more >
Defining Layout Parameters for Dynamically Built More Detail Views
You can specify layout parameters for each of the more detail views created from a selected object. Complete the following steps to specify...
Read more >
Unity Tutorial: 3 Ways to Indicate Selected Units | Part 1
We 'll cover making changes to the material, having a 3d selection box around the object (both flat on the ground and in...
Read more >
Properties | AutoCAD 2020 - Autodesk Knowledge Network
You can assign properties such as color and linetype to individual ... Selecting objects is covered in more detail in the Modifying topic....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found