在使用Rails一段时间之后,我经常使用“rails路由”来快速了解项目中现有的路由。
现在我正在从事一个Angularjs项目(~1.48)。有什么方法可以对项目定义的路线进行概述吗?
发布于 2017-10-26 12:09:12
我想你可以用$state.get()
尝试在控制器内使用此方法:
app.controller('Controller', function ($state) {
console.log(angular.toJson($state.get()));
});下面是这方面的文档:
/**
* @ngdoc function
* @name ui.router.state.$state#get
* @methodOf ui.router.state.$state
*
* @description
* Returns the state configuration object for any state by passing the name
* as a string. Without any arguments it'll return a array of all configured
* state objects.
*
* @param {string|object} stateOrName The name of the state for which you'd like
* to get the original state configuration object for.
* @returns {object} State configuration object or array of all objects.
*/https://stackoverflow.com/questions/46953902
复制相似问题