Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ng-switch should allow non ng-when children #1074

Closed
vojtajina opened this issue Jun 18, 2012 · 5 comments
Closed

ng-switch should allow non ng-when children #1074

vojtajina opened this issue Jun 18, 2012 · 5 comments

Comments

@vojtajina
Copy link
Contributor

    <tr ng-switch on="foo">
        <th>first</th>
        <th ng-switch-when="1">one</th>
        <th ng-switch-when="1">two</th>
        <th ng-switch-when="2">three</th>
        <th>last</th>
    </tr>

Currently ng-switch does just append(), so the dynamically added elements are inserted after the static ones (first, last).

@marcja
Copy link

marcja commented Jun 19, 2012

Note as well that there are multiple when statements with the same value. This is also desired behavior.

@rzschech
Copy link
Contributor

I would like both non-ng-switch-when children and multiple ng-switch-when with the same value also.

lgalfaso added a commit to lgalfaso/angular.js that referenced this issue Feb 6, 2013
Added the ability to handle multiple matches on ng:switch-when and ng:switch-default

Closes angular#1074
@gauthamses
Copy link

Hi ,

I guess the issue still exists. Please refer http://plnkr.co/edit/4zTsEQKiYGOiAcPYo8PJ

Note that the element "some other text is static but the dynamically added elements are inserted after the static element (some other text).

@jbdeboer
Copy link
Contributor

jbdeboer commented Mar 1, 2013

Looking at the tests in e394ec3, I don't think that commit fixed this problem.

@jbdeboer jbdeboer reopened this Mar 1, 2013
@lgalfaso
Copy link
Contributor

lgalfaso commented Mar 4, 2013

The patch adds the directive ng-switch-always. Elements inside a ng-switch marked with this new directive, show up always regardless if there is a case match or matches the default. The added benefit is that the element show up at the position declared

lgalfaso added a commit to lgalfaso/angular.js that referenced this issue Mar 9, 2013
Preserve the order of the elements that are not part of a case nor default in
a ng-switch directive

Closes angular#1074
jbdeboer pushed a commit to jbdeboer/angular.js that referenced this issue Mar 11, 2013
Preserve the order of the elements that are not part of a case nor default in
a ng-switch directive

Closes angular#1074
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants