当前位置:  开发笔记 > 编程语言 > 正文

控制器的ngdoc文档

如何解决《控制器的ngdoc文档》经验,为你挑选了1个好方法。

我是新来的代码文档,并试图用grunt-ngdocs记录我的角度应用程序.

我从以下网址克隆了一个工作示例:https://github.com/m7r/grunt-ngdocs-example

给定的示例缺少文档控制器,因此我使用以下代码添加了自己的文档控制器:

 /**
  * @ngdoc controller
  * @name rfx.controller:testCtrl
  * @description 
  * Description of controller.
  */
 .controller('testCtrl', function() {
 });

当我尝试通过从命令行运行grunt来构建文档时,我收到以下错误消息:

Warning: Don't know how to format @ngdoc: controller Use --force to continue.

我该如何解决?我阅读了本指南http://www.shristitechlabs.com/adding-automatic-documentation-for-angularjs-apps/,如果我尝试记录控制器,我无法弄清楚为什么我会不断收到错误消息:(谢谢任何帮助!



1> Ankit Tanna..:

以下是如何记录样品控制器的方法:

/**
 * @ngdoc function
 * @name appModernizationApp.controller:DetailsCtrl
 * @description
 * # DetailsCtrl
 * Controller of the appModernizationApp
 * This controller is responsible for showing the details of the page.
 * It gets initialized by requesting the JSON for types of rooms which is hosted on the server.
 * It also requests for the details of the room for an existing reservation if the reservation id is present in the route using HRS.getRegisteredData(reservationId).
 * @requires $scope
 * @requires $http
 * @requires HRS
 * @requires $location
 * @requires $routeParams
 * @requires breadcrumbs
 * @requires UtilitiesService
 * 
 * @property {object} breadcrumbs:object breadcrumbs Handles the page level/navigation at the top.
 * @property {array} reservationDetails:array This holds the reservation details of the current/selected reservation.
 * @property {string} registerationErrorMsg:string This variable holds the error message for all registration services.
 * @property {string} roomSearchErrorMsg:string This variable holds the error message for all room search services.
 * @property {array} roomDetails:array This holds the room details object. This will be a fresh object coming from service response and will be manipulated as per the view model.
 * @property {boolean} submitted:boolean Holds the submitted boolean flag. Initialized with false. Changes to true when we store the details.
 * @property {number} reservationId:number Gets the reservation id from the route params.
 * @property {date} minDate:date Date filled in the minimum date vatiable
 * @property {boolean} isRoomDetailsVisible:boolean Controls the boolean flag for visibility of room details. Initialized with false.
 * @property {array} roomTypes:array Holds types of rooms from JSON.
 * @property {array} expirymonth:array Months from Jan to Dec
 * @property {array} expiryYear:array Years of a particular range
 * @property {array} cardtype:array Type of cards
 */

推荐阅读
帆侮听我悄悄说星星
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有