user1184100
user1184100

Reputation: 6894

Conditionally displaying using ng-show

I'm trying to conditionally display using ng-show in angular and it doesn't seem to work. Where am I going wrong ?

<body ng-controller="MainCtrl">   
    <select ng-model="type" ng-init="type='WEP'">
      <option value="None">None</option>
      <option value="WEP">WEP</option>
      <option value="WPA">WPA</option>
      <option value="WEP Admin">WEP Admin</option>
    </select>
    <p ng-show="type == 'WEP' || 'WPA' ">{{type}}</p>
</body>

Demo : http://plnkr.co/edit/jvqW2w6hg6gq6YVsjAgh?p=preview

Upvotes: 0

Views: 99

Answers (1)

Lalit Sachdeva
Lalit Sachdeva

Reputation: 6639

<p ng-show="type == 'WEP' || type == 'WPA' ">{{type}}</p>

please try this.

Upvotes: 1

Related Questions