Skip to content

Commit

Permalink
More typos and add syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
cibernox committed Jul 19, 2016
1 parent f331571 commit 9fcc05d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions text/router-enhancements.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ any other would cause the route to miss.
Mimicking rails micro syntax, I propose optional segments to be enclosed between parenthesis. The
example of the Apple store would be encoded

```
```js
Router.map(function() {
this.route('product', { path: '(/:region)/:productName' });
});
Expand Down Expand Up @@ -188,7 +188,7 @@ at once? Per example:

```js
Router.map(function() {
this.route('forecast', {
this.route('activities', {
path: 'activities/from/:from/to/:to',
constraints: function(from, to) {
// This constraint takes both dynamic segments and performs an assertion
Expand All @@ -199,8 +199,8 @@ Router.map(function() {
});


router.serialize('/activitis/from/2016-04-11/to/2016-05-20'); // => matches
router.serialize('/activitis/from/2016-06-11/to/2016-05-20'); // => fails to match
router.serialize('/activities/from/2016-04-11/to/2016-05-20'); // => matches to `activities`
router.serialize('/activities/from/2016-06-11/to/2016-05-20'); // => fails to match
```

- How complex can constraints be? Just pure functions or can they have access to services? I think
Expand Down

0 comments on commit 9fcc05d

Please sign in to comment.