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>

2 Answers 2

2

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

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

Comments

1

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

1 Comment

Thanks. But can I use <a ng-switch-when="row.id.indexOf(':') < -1 === true" href = "..." /> in the same switch ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.