Home selected boolean value on angular ng-options
Reply: 0

selected boolean value on angular ng-options

user786 Published in July 20, 2018, 4:48 am

The boolean value assigned to the model doesn't pre-select the corresponding option - shows first an empty option instead:


<select data-ng-model="scriptData.privacy" data-ng-options="privacyOption.value as privacyOption.label for privacyOption in privacyOptionsSelect track by privacyOption.value"></select>

Options in the controller:

                label:'Registered users only can view this',
                value: false
                label:'Anyone with the link can view this',
                value: true

scriptData.privacy is set to false.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.32212 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO