Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing selected value from controller #47

Open
aldarund opened this issue Mar 14, 2015 · 1 comment
Open

Changing selected value from controller #47

aldarund opened this issue Mar 14, 2015 · 1 comment

Comments

@aldarund
Copy link

How to set a currently selected value from controller?
I tried to change the value of the model, but it does nothing for select. And i didnt find any other ways in the documentation.

@lordfriend
Copy link
Owner

Change value of the model should be able to change the select.

Notice: You model value must equal to one of the select option value. the option value has several type depends on the value attribute.

If no value attribute exists on nya-bs-option directive. the option value is defined by option of option in collections ( assume this is your expression on nya-bs-option ).

If value attribute is set, the option value is set by the expression of value attribute, which evaluated in the scope of each nya-bs-option directive.

If you're using static options. the option value is equal to the content of value attribute.

You can found some examples in the examples directory.

https://github.com/lordfriend/nya-bootstrap-select/blob/master/examples/index.html#L47-L60

Here are an live example copied from the examples directory

http://plnkr.co/edit/b6xg3YcEBBtEKH8iYenl?p=preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants