Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngSelected not updated with ngModel (parentheses weird behavior) #6528

@MBing

Description

@MBing

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions