Questions tagged [ng-switch]

The ngSwitch directive is used to conditionally swap DOM structure on your template based on a scope expression. Elements within ngSwitch but without ngSwitchWhen or ngSwitchDefault directives will be preserved at the location as specified in the template.

Usage

<ANY ng-switch="expression">
  <ANY ng-switch-when="matchValue1">...</ANY>
  <ANY ng-switch-when="matchValue2">...</ANY>
  <ANY ng-switch-default>...</ANY>
</ANY>
197 questions
1
vote
1 answer

how to implement Radio Button with ng-switch in angular5?

Working with angular5 , i found this code in internet , i tried to run it as i want the same thing in my application , it doesn't work as expected ,the problem is that i can check all the radio Button , also i can see the first message even …
dEs12ZER
  • 788
  • 4
  • 24
  • 51
1
vote
1 answer
1
vote
2 answers

Remove empty option in the select using ng-model

I am new to angular js. In my code user changes the value of radio buttons. And depending on the value of the selected radio button, a piece of code is loaded from the ng-switch HTML:
1
vote
2 answers

Testing ngSwitch with Jasmine

I have a piece of HTML in my component:
Mode 1 Activated Mode 2 Activated
and I want to test it through karma-jasmine.…
Mike M
  • 4,879
  • 5
  • 38
  • 58
1
vote
0 answers

Using ngbTooltip Inside ngSwitch Throws Error When Destroyed

I'm using Angular 2 and ng-bootstrap. I've got an [ngSwitch] with different tooltips defined in the content based on the case. When the [ngSwitch] variable changes, the tooltip throws an exception: this._unregisterListenersFn is not a function at…
HaveSpacesuit
  • 3,572
  • 6
  • 40
  • 59
1
vote
0 answers

Angular js : Dynamic expression not working for ng-switch

I have a div based on switch but the switch has a boolean variable(hasUrl) and expression. Can some one tell me what I am doing wrong here ?
user3407267
  • 1,524
  • 9
  • 30
  • 57
1
vote
1 answer

ng-switch not working with md-tabs

I'm trying to create conditional md-tabs using ng-switch. I know that works fine with ng-if but I would much appreciate the ng-switch-default since there isn't ng-else. Here's a example html:
Settings …
William D
  • 65
  • 1
  • 10
1
vote
1 answer

A new on-the-fly variable from ng-repeat is not visible outside the ng-switch

I have a label showing amount of filtered items in my code like this
Filter:
Franky_frankly
  • 361
  • 1
  • 4
  • 13
1
vote
1 answer

ng-switch causing error in uploading

I used the answer in this link nodejs + multer + angularjs for uploading without redirecting for making file uploads in angularjs. This works perfectly. According to my requirements i edited the code of angular html file (added ng-switch):
Gaurav Gupta
  • 1,929
  • 4
  • 21
  • 40
1
vote
1 answer

ng-view for multiple form load in single page application

I am trying to load different form based on user interaction in single page application. ng-view was helpful until i had to load/hide forms in different divs of same page. div#1: it will have catalog names populated from ng-repeat. div#2: should…