#16083 closed enhancement (fixed)
dojo/router: pass captures as additional args to the handler
Reported by: | ben hockey | Owned by: | Brian Arnold |
---|---|---|---|
Priority: | low | Milestone: | 1.9 |
Component: | Core | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
currently the captures are found on the event object passed to the handler in the evt.params
array.
i'd like to suggest an enhancement to also pass those params as additional callbacks to the handler function. for example:
router.register(/^(foo)\/(bar)$/, function (evt, foo, bar) { … };
this is similar to what i've seen with django https://docs.djangoproject.com/en/dev/topics/http/urls/#example and sort of like what happens when you use replace
on a string:
'abc'.replace(/(a)(b)(c)/, function (matched, a, b, c) { console.log(arguments); });
Change History (4)
comment:1 Changed 9 years ago by
Owner: | set to Brian Arnold |
---|---|
Status: | new → assigned |
comment:2 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Priority: | undecided → low |
comment:3 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 8 years ago by
Added this feature, along with tests for both string and regex routes. Thanks for the suggestion, neonstalwart!
Note: See
TracTickets for help on using
tickets.
In [31142]: