Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtering value in the options list
Message
 
 
To
All
General information
Forum:
Javascript
Category:
Other
Title:
Filtering value in the options list
Miscellaneous
Thread ID:
01641816
Message ID:
01641816
Views:
25
Hi everybody,

I am trying to figure out how to exclude one value in the list, e.g. this is my current code
<label class="control-label">
                @Labels.row:
            </label></div>

            <div class="col-xs-3">
                <select class="form-control" ng-model="currentMatrixTemplate.rowAttributeId"
                        ng-options="class.value as class.text for class in metaData.attributes"></select>

            </div>
I need to make sure that the list of options doesn't include the option selected in the second drop down which uses currentMatrixTemplate.columnAttributeId.

I am not sure how to write the filter syntax.

UPDATE. Found this one http://stackoverflow.com/questions/26215274/angularjs-ng-options-to-exclude-specific-object which I believe I found before too when I faced a similar problem. Going to try that now.

UPDATE2. Yes, it works like a charm.
<select class="form-control" ng-model="currentMatrixTemplate.rowAttributeId"
                        ng-options="class.value as class.text for class in metaData.attributes |filter: { value: '!' + currentMatrixTemplate.columnAttributeId }"></select>
If it's not broken, fix it until it is.


My Blog
Reply
Map
View

Click here to load this message in the networking platform