我正在尝试使用 ngdocs 和 grunt 记录我的 Angular WebApp。我想知道有没有一种方法可以记录路由配置,因为我觉得我的 WebApp 路由系统相当复杂,它的文档部分需要一些注意。
无论如何我可以在 Controller 、工厂等级别上使用它
我可以把它放在下面吗:
/**
* @ngdoc controller
* @name shippingSolutionApp.controller:MainCtrl
* @description
* # MainCtrl
* <strong>PAGE LEVEL CONTROLLER:</strong> This is a page level controller.
*
* This is a empty controller of shippingSolutionApp. Any business logic to initiate the app must fall here when required.
*
* This holds the initialization process for both the sub-child WebApps: Admin Dashboard and User Dashboard
* @requires
* $scope
*/
谢谢, 安 git
最佳答案
像这样的东西让你入门怎么样?
这不是一个很好的答案,因为我还没有写过要为 @description
写什么,但希望这说明了一种开始使用 ngdocs 来记录有关路由的内容的方法。
/**
* @ngdoc overview
* @name app.config:routes
* @description
* Your description here.
*/
angular
.module('app')
.config(['$routeProvider', '$locationProvider', config]);
function config ($routeProvider, $locationProvider) {
$routeProvider
.when(
templateUrl : 'app/example.view.html',
controllerAs: 'example',
controller : 'ExampleController'
)
.otherwise({
redirectTo: '/'
});
}
关于javascript - 如何在 routeConfig 中使用 ngDoc 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29983431/