2

I am trying to document my Angular WebApp using ngdocs and grunt. I want to know that is there a way to document a route configuration because I feel that my routing system of WebApp if fairly complex and it needs some attention in its documentation part.

Is there anyway I can have it on the levels of controllers, factory etc.

Can I place it on below level:

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

Thanks, Ankit

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Ankit Tanna
  • 1,779
  • 8
  • 32
  • 59

1 Answers1

1

How about something like this to get you started?

It’s not a great answer because I have not written about what to write for @description, but hopefully this illustrates a way to start using ngdocs to document something about the routing.

/**
 * @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: '/'
    });
}
paulhhowells
  • 321
  • 3
  • 11