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

feat(directive): ng:switch-always #2096

Closed
wants to merge 1 commit into from

Conversation

lgalfaso
Copy link
Contributor

@lgalfaso lgalfaso commented Mar 4, 2013

New directive to show elements inside a switch statement regardless if there
was a case match or the match was to a default
Elements marked as ng-switch-always show up in the position that they were
declared inside the ng-switch

Closes #1074

@jbdeboer
Copy link
Contributor

jbdeboer commented Mar 4, 2013

This is a useful hack, but the syntax is not pretty.

How difficult would it be to re-do ng-switch to preserve the order of the elements so we don't need this hack?

@lgalfaso
Copy link
Contributor Author

lgalfaso commented Mar 4, 2013

For sure it is possible without the ng-switch-always :-)

@lgalfaso
Copy link
Contributor Author

lgalfaso commented Mar 6, 2013

Just to be sure, is fcfb400e951b0dbb89505226d273dd6bc4c2943f what you were thinking in?

@jbdeboer
Copy link
Contributor

jbdeboer commented Mar 8, 2013

Sorry for the delay. Yes, that is exactly what I was thinking.

@jbdeboer
Copy link
Contributor

jbdeboer commented Mar 8, 2013

  • Contributor signed CLA now or in the past (if you just signed, leave a comment here with your real name for cross reference)
  • Feature improves existing core functionality
  • API is compatible with existing Angular apis and relevant standards (if applicable)
  • PR doesn't contain a breaking change (This is a breaking change)
  • PR contains unit tests
  • PR contains documentation update
  • PR passes all tests on Travis (sanity)
  • PR passes all tests on ci.angularjs.org (cross-browser compatibility)
  • PR is rebased against recent master
  • PR is squashed into one commit per logical change
  • PR's commit messages are descriptive and allows us to autogenerate release notes (required commit message format)
  • All changes requested in review have been implemented

@lgalfaso
Copy link
Contributor Author

lgalfaso commented Mar 9, 2013

Squash this into a single commit to make it easy to review

@IgorMinar
Copy link
Contributor

I like the direction of this PR. ngSwichAlways looked bad. The current solution is much more elegant.

@lgalfaso
Copy link
Contributor Author

lgalfaso commented Mar 9, 2013

Fixed the issues posted.
Rebase to have a single commit with all the changes

Preserve the order of the elements that are not part of a case nor default in
a ng-switch directive

Closes angular#1074
@jbdeboer
Copy link
Contributor

@jbdeboer
Copy link
Contributor

landed as e88d617

@jbdeboer jbdeboer closed this Mar 11, 2013
@lrlopez
Copy link
Contributor

lrlopez commented Mar 12, 2013

Nice work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng-switch should allow non ng-when children
4 participants