0

I have a div based on switch but in one particular case even when switch case will be true I need to display another link based on different condition. Can some one suggest me any ideas ?

  <div ng-switch="hasUrl">
    <a ng-switch-when="true && row.id.indexOf(:) < 0" href="{{url + row.id}}">
    {{getName(row)}}
    </a>
    <a ng-switch-default href=".......">
      {{getName(row)}}
    </a>
  </div>
jmona789
  • 2,711
  • 6
  • 24
  • 57
user3407267
  • 1,524
  • 9
  • 30
  • 57

2 Answers2

1

You may need other tags such as ng-show and ng-if

Chiu
  • 374
  • 2
  • 10
1

ngswitch only allows you to compare a single condition.

if you want to test multiple conditions you can use ng-if

If you still need to use multiple conditions, look at the answer with a directive.

AngularJS: ng-switch-when with an OR

Community
  • 1
  • 1
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396