gpt4 book ai didi

javascript - Controller 的 ngdoc 文档

转载 作者:数据小太阳 更新时间:2023-10-29 04:38:23 25 4
gpt4 key购买 nike

我是代码文档的新手,并尝试使用 grunt-ngdocs 记录我的 Angular 应用程序。

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

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

 /**
* @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/而且我不明白为什么在我尝试记录 Controller 时会不断收到错误消息 :( 感谢您的帮助!

最佳答案

以下是记录示例 Controller 的方法:

/**
* @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 <b>HRS.getRegisteredData(reservationId)</b>.
* @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
*/

关于javascript - Controller 的 ngdoc 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34299037/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com