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

Improved Angular routing in a backwards compatible way. #1634

Closed
wants to merge 2 commits into from
Closed

Improved Angular routing in a backwards compatible way. #1634

wants to merge 2 commits into from

Conversation

xealot
Copy link

@xealot xealot commented Nov 30, 2012

General routing improvements to support slash matching, ordered routing of ambiguous urls, typed groups and likely performance improvements.

Angular now basically supports the werkzeug routing syntax.
/foo/:bar
/foo/<path:bar>
/foo/<string:bar>/
/foot/<path:bar>/:id/

Addresses:

Addresses:
- A TODO where most routes was being compiled and processed every single route change. Routes are now processed up front and simply matched

- Routes are now processed in the order in which they are added instead of arbitrarily.

- Helps with #1147
- Helps with #1159
- Makes #918 easier

- It is now possible to match the forwardslash character.

- It is now possible to restrict your match to string, int or path.
@tdterry
Copy link

tdterry commented Nov 30, 2012

+1

@pkozlowski-opensource
Copy link
Member

@xealot thnx for your contribution! This PR will require some more work before it can be merged. In particular, could you go over the http://docs.angularjs.org/misc/contribute and make sure that:

  • documentation is updated
  • CLA signed
  • commit message follow the guidelines - you should also squash 2 commits into one.

@pkozlowski-opensource
Copy link
Member

@xealot One more question: I can't instantly see how your PR helps with #1159. Could you elaborate?

@lrlopez
Copy link
Contributor

lrlopez commented Dec 2, 2012

Cool! I only miss documenting the new route syntax in the source code...

@pkozlowski-opensource
Copy link
Member

@lrlopez you got me confused... You and the @xealot are not the same person, are you? If not, what is your comment referring to?

@lrlopez
Copy link
Contributor

lrlopez commented Dec 2, 2012

@pkozlowski-opensource: No, we are not. This PR covers the functionality of #1147 which ultimately got reworked by me into #1560.

I said that the PR is cool because it enhances the route specification by allowing restricting params to int, string and path values.

But, as you said before, the PR must be reworked in order to being taken into consideration. This means rebasing, including documentation and rewriting the commit message.

Sorry about confusing you!

@xealot
Copy link
Author

xealot commented Dec 2, 2012

@pkozlowski-opensource CLA is signed, I must have fat fingered #1159, because that doesn't seem relevant at all. I believe there is another routing/matching open somewhere that this addresses fully or in part.

I will attempt to correct the lack of documentation and squish the commits.

@lrlopez thanks, the tests are a decent source to see how it works. I will try to put the documentation in the source. Also if you look at the way werkzeug does routing this mirrors that strategy.

@georgiosd
Copy link

Is this going to be in the new release of angular?
Does it allow change of ordering of parameters? Do it allow parameters to be omitted?

Thank you

@mhevery
Copy link
Contributor

mhevery commented Feb 15, 2013

PR is stale. Can not be merged to master (needs to be rebase) Master already has similar feature (*path) wich makes this PR less useful. For this reason, I am closing it, feel free to reopen once fixed up.

@mhevery mhevery closed this Feb 15, 2013
@georgiosd
Copy link

This, however, is much more flexible than the catch-all

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.

6 participants