cant set active / selected items
See original GitHub issueHey, i am using ng2-select and i am quiet satisfied. I spent the last 3 hours to set the initial data of the select.
My first attempt was to use "active: code:
<ng-select [active]="active"...
public active = ['Amsterdam'];
Compiler:
Can’t bind to ‘active’ since it isn’t a known property of ‘ng-select’
After that I tried around with some hacks but so far I couldnt find a solution. I also want to use it as a multi select, but i am already failing on the single selection. Unfortunately there is no demo and i am out of ideas…
Another little thought: CSS height is not working correctly. I have to set the height initially but if it changes (like on multiselect), therefore the hight stays the same…
Thank you for this very helpful component!
Greetings Emanuel
Issue Analytics
- State:
- Created 7 years ago
- Comments:17
Top Results From Across the Web
Can't set active item of BottomNavigationView while recreating ...
Can't set active item of BottomNavigationView while recreating app: the last selected item is active after recreating app, so ...
Read more >mdb-select not setting ACTIVE class for selected option
On page load, the form displays the previous selected item - ie the :selected item is displayed, but the .active class is NOT...
Read more >8 reasons why you cannot select your object in Blender
Press P then choose selection or use "by loose parts" if you want to separate all loose individual mesh pieces into different objects...
Read more >You are unable to select unprotected cells in Excel
Workaround · Do not clear the Select Locked Cells check box when you protect a worksheet: Start Excel, open your workbook, and then...
Read more >Home - SET ACTIVE
Constructed by us, activated by you. Designed to flatter, sculpt and lift.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have found the solution, you need to set the active attribute like this: [active]=“[arrayWithObjects[objectIndex]]”
In most cases this means you should refactor your data object to this format to get It working.
[active]=“value[0]” must be the array