addyosmani / addyosmani/backbone-fundamentals
Chapter 3, Routers section
- 主要语言
- Rich Text Format
- 星标
- 9.2k
- 派生
- 1.4k
- PR 合并指标
- 30 天内没有已合并 PR
描述
At the very end of the Routers section the following explanation and code:
**A "route" event is also triggered on the router in addition to being fired on Backbone.history**.
```
Backbone.history.on('route', onRoute);
// Trigger 'route' event on router instance.
router.on('route', function(name, args) {
console.log(name === 'routeEvent');
});
location.replace('http://example.com#route-event/x');
Backbone.history.checkUrl();
```
Is the objective to show that by binding the 'route' event to history and Router, you may monitor URL changes?.
Perhaps the example would become more clear if instead of 'onRoute', an actual function and an explanation of the difference between the two were provided with a reference to the docs for more information.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。