0

I have select tag like this

<select> 
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>

i want to hide the options which are present in the following array object as a priority.

$scope.items = [{itemname:abc, priority:2},{itemname:def,priority:4}]
1
  • What you tried so far ? Commented May 23, 2017 at 8:18

2 Answers 2

1

You can simply call a method to check for visibility of option via ng-show or ng-hide.

See this Fiddle.

further your itemname should be string, like itemname:'abc'

Sign up to request clarification or add additional context in comments.

Comments

0

I think you need use ng-options:

<select ng-options="item for item in items"> 

And "items" - must be array in your controller. So you can manipulate by it

1 Comment

I think question is about hiding of options if same priority is exist in $scope.items array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.