本文介绍了我们可以查看emberjs中的所有路线,还有一些类似于耙子路径在rails中的路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于emberjs中的路由文件变大,我发现很难跟踪emberjs应用程序支持的所有路由,rails中的rake路由给出了rails应用程序中的路由列表,有没有办法生成路线类似于emberjs?

解决方案

目前,您可以使用 App.Router访问所有现有路线。 router.recognizer.names 或只是使用 Ember.keys(App.Router.router.recognizer.names)的名称。



它显然不如Rails路线那么广泛,但它给出了一个快速而肮脏的概述。


As the routes file in emberjs is becoming large, I am finding it difficult to keep track of all the routes supported by emberjs app, rake routes in rails gives a list of routes in the rails app, is there a way to generate routes in similar fashion for emberjs?

解决方案

Currently you can access all existing routes with App.Router.router.recognizer.names or just the names using Ember.keys(App.Router.router.recognizer.names).

It's obviously not as extensive as the Rails routes but it gives a quick and dirty overview.

这篇关于我们可以查看emberjs中的所有路线,还有一些类似于耙子路径在rails中的路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:59