You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
So as you can see I have the ngModel defined in ngSelected and gave it the number 5 (now it is default in my controller, but in my own example it is updated automatically, but this reflects the same problem I am having and was easier to explain/show)
this is noted as:
ng-selected="referenceNumber)"
You can also put this as:
ng-selected="(referenceNumber"
and it will also select the correct value given in the model.
But if I where to put no parentheses or other brackets in place or just open
and close it with parentheses, the ngSelected directive is not recognizing the value
and it will default to 0.
Is there's something I am missing or have misinterpreted while making this, which brings me to this unreasonable solution? I know there is ngOptions as a directive to use, but this solution worked and it was closest to what I wanted to accomplish.
Thank you!
Martin
The text was updated successfully, but these errors were encountered:
I'm not sure why the ")" thing is working, but you do not need ngSelected when using a select element in this manner. Just setting the model will init the select box with the desired result.
Thanks @joshkurz ! I noticed if I wanted to use another model to specify the ngSelected, this is not working, so why is there even the ngSelected directive when you can only use the ngModel to be the selected value.
I think the value with only 1 parenthesis is working because it is not executed as it is not valid. So it skips it and it keeps the solution you just gave.
Make's sense?
I haven't found something similar to this problem. If there is, my apologies and please redirect me.
See this for an example of my problem:
http://plnkr.co/edit/Eu49n2tTB3IQYSaNLQDt
So as you can see I have the ngModel defined in ngSelected and gave it the number 5 (now it is default in my controller, but in my own example it is updated automatically, but this reflects the same problem I am having and was easier to explain/show)
this is noted as:
ng-selected="referenceNumber)"
You can also put this as:
ng-selected="(referenceNumber"
and it will also select the correct value given in the model.
But if I where to put no parentheses or other brackets in place or just open
and close it with parentheses, the ngSelected directive is not recognizing the value
and it will default to 0.
Is there's something I am missing or have misinterpreted while making this, which brings me to this unreasonable solution? I know there is ngOptions as a directive to use, but this solution worked and it was closest to what I wanted to accomplish.
Thank you!
Martin
The text was updated successfully, but these errors were encountered: