2015-05-01 26 views
2

我正在嘗試使用ngdocs和grunt來記錄我的Angular WebApp。我想知道是否有一種方法來記錄路由配置,因爲我覺得我的WebApp路由系統相當複雜,而且它的文檔部分需要注意。如何使用ngDoc註釋routeConfig

反正我可以有它的控制器,工廠等的水平

我可以將它放在以下級別:

/** 
* @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 
*/ 

感謝, ANKIT

回答

1

怎麼樣東西像這樣讓你開始?

這不是一個很好的答案,因爲我沒有寫關於爲@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: '/' 
    }); 
}