Permalink
Browse files

Reworded navigation section with trigger:true option. Also changed op…

…tion name from 'navigate' to 'trigger' to match the Backbone documentation (and source code).
  • Loading branch information...
1 parent df84b8b commit 2a0fdb8a009c872b12f38a93be6a93de0865837d @dcmaf dcmaf committed Mar 31, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 chapters/03-internals.md
View
@@ -1608,9 +1608,9 @@ Backbone.history.start();
// logs: View todo requested.
```
-It is also possible for `Router.navigate()` to trigger the route as well as update the URL fragment.
+It is also possible for `Router.navigate()` to trigger the route along with updating the URL fragment by passing the `trigger:true` option.
-Note: The first we presented earlier is the preferred form, such as dropping a bookmark when your application transitions to a specific place. `navigate:true` is available, but it's usage is discouraged.
+Note: This usage is discouraged. The recommended usage is the one described above which creates a bookmarkable URL when your application transitions to a specific state.
```javascript
var TodoRouter = Backbone.Router.extend({
@@ -1622,7 +1622,7 @@ var TodoRouter = Backbone.Router.extend({
viewTodo: function(id){
console.log("View todo requested.");
- this.navigate("todo/" + id + '/edit', true); // updates the fragment and triggers the route as well
+ this.navigate("todo/" + id + '/edit', {trigger: true}); // updates the fragment and triggers the route as well
},
editTodo: function(id) {

0 comments on commit 2a0fdb8

Please sign in to comment.