MeteorJS: Routing with Backbone.js

倖福魔咒の 提交于 2019-12-05 20:26:20

I debug the code and find out that 'id' in collection is an integer, while session_id is a string. You need parseInt to convert session_id.

I use page.js for routing, which is "Micro client-side router inspired by the Express router", an excellent work from "TJ Holowaychuk".

I strongly suggest it, since Meteor and backbone have some feature collisions in Model/Collection & View/Template.

Jifeng was right in the sense of if you only need routing capability then page.js is good enough.

Jifeng and I are in a same team. We had the conclusion of "Meteor and Backbone have some feature collisions in Model/Collection & View/Template" until recently. As our understanding on both Meteor and Backbone go deeper, that conclusion is in need of re-evaluation. Please refer to my last experiment code as BBCloneMail-on-Meteor: Derick Bailey's BBCloneMail modified to run on Meteor. The key is to implement a Backbone storage plugin to wire in Meteor's collection. Once the plugin wiring is in effect, there is only a little modification needed.

You might find iron router of interest - it's meteor specific and "knows about your subscriptions, data sources and helps you take care of common problems": https://github.com/EventedMind/iron-router

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!