[Pkg-javascript-commits] [backbone] 69/173: Give a nested route example
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 07:44:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository backbone.
commit 4c98b02b40fc62b42c363bdd5c66d3133a5dfbf2
Author: Justin Ridgewell <jridgewell at users.noreply.github.com>
Date: Mon Dec 7 11:25:07 2015 -0500
Give a nested route example
---
index.html | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index fe7bb52..e49fe07 100644
--- a/index.html
+++ b/index.html
@@ -2406,8 +2406,8 @@ var Workspace = Backbone.Router.extend({
<p>
A route of <tt>"file/*path"</tt> will match
- <tt>#file/nested/folder/file.txt</tt>, passing
- <tt>"nested/folder/file.txt"</tt> to the action.
+ <tt>#file/folder/file.txt</tt>, passing
+ <tt>"folder/file.txt"</tt> to the action.
</p>
<p>
@@ -2418,6 +2418,13 @@ var Workspace = Backbone.Router.extend({
</p>
<p>
+ A nested optional route of <tt>"docs(/:section)(/:subsection)"</tt> will match
+ <tt>#docs</tt>, <tt>#docs/faq</tt>, and <tt>#docs/faq/installing</tt>,
+ passing <tt>"faq"</tt> to the action in the second case, and passing <tt>"faq"</tt>
+ and <tt>"installing"</tt> to the action in the third.
+ </p>
+
+ <p>
Trailing slashes are treated as part of the URL, and (correctly) treated
as a unique route when accessed. <tt>docs</tt> and <tt>docs/</tt> will fire
different callbacks. If you can't avoid generating both types of URLs, you
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list