Is there an Ember.js equivalent to Backbone.js Router for history and hash changes?

℡╲_俬逩灬. 提交于 2019-12-10 17:09:55

问题


In Backbone.js you can use the Router to bind to # changes to navigate around a single-page HTML5 app.

Is there an equivalent for Ember.js? Or have I missed something fundamental about its design?


回答1:


There are plans to write a router for Ember. It will likely be integrated with the Ember StateManager. For now, you can use sproutcore-routing or another routing solution. I'm currently using sproutcore-routing successfully, but it has some limitations.




回答2:


You may also want to have a look at Ember RouteManager




回答3:


Take a look at that Anatomy of a Complex Ember.js App Part I: States and Routes and ember-routemanager.




回答4:


You might want to check this out: https://github.com/emberjs-addons/sproutcore-routing




回答5:


I'd imagine this has been left out to keep things "loosely coupled". You could use a self-contained alternative, for instance Sammy or http://davisjs.com/.




回答6:


Sproutcore-Statechart (for Ember) also has routing support now: https://github.com/emberjs-addons/sproutcore-statechart




回答7:


As of Ember 1.0, Ember has a built-in first-class Router.



来源:https://stackoverflow.com/questions/8886837/is-there-an-ember-js-equivalent-to-backbone-js-router-for-history-and-hash-chang

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