- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试根据以下结构创建文档:
/**
* @ngdoc service
*
* @name module:resource
* @module module
* @ return {Object} The returned object
*/
angular.module('module').factory('resource', [
function () {
function Foo (param1) {
//Do something with param1
}
return {
Test: {
/**
* @ngdoc function
* @name resource#theTest
* @methodOf module:resource
*
* @description
* Search to see if a study exists with the given protocol identifier
* @param {Object} params The param
* @return {Object} A Promise
*/
theTest: function(param) {
return functionFoo (param);
},
/**
* @ngdoc function
* @name resource#theTest1
* @methodOf module:resource
*
* @description
* Search to see if a study exists with the given protocol identifier
* @param {Object} params The param
* @return {Object} A Promise
*/
theTest1: function(param) {
return functionFoo (param)
}
}
};
}
]);
我想在文档中说的是服务“资源”返回一个返回函数集合的对象,但我找不到使用 ngdocs 执行此操作的方法。是否支持?
谢谢
最佳答案
我认为您不能指定“函数映射”,唯一受支持的类型是函数、对象、字符串、数字...但是您可以改为在您的类(class)中添加描述,例如:
/*
* @description
* This class return 2 functions as describe below:
* ```js
* {
* theTest {Function} This function do (...)
* theTest1 {Function} This function do (...)
* };
* ```
*/
function Foo (param1) {
希望对你有帮助
关于javascript - 如何用ngdocs描述一个提供函数集合的返回对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24314373/
我正在尝试获取一个基本示例,以便在我的 Angular 项目中使用 ngDoc。 这是一个例子: /** * @ngdoc directive * @name ui.components.uiRe
有 2 个 grunt 插件用于为 Angularjs 应用程序生成文档。 https://www.npmjs.org/package/grunt-ngdoc https://www.npmjs.or
我在我的团队中为一个框架编写文档,我想添加提供者。 当我添加@ngdoc 提供程序时,它对我说: 不知道如何格式化 @ngdoc: provider 我查看了 ngRoute 的 Angular 模块
如何使用 ngDoc 记录一个常量?我没有看到任何 Angular 特定的文档来记录使用 .constant 注册的值,并且常量的 jsDoc 语法在通过 ngDoc 运行时似乎不会生成任何实际的文档
我最近开始在我的 Angular 应用程序中使用 ngdocs,并且我对如何明智地记录模块配置和运行 block 感到困惑。 我目前有这个: /** * @ngdoc overview * @na
我正在尝试设置 ngdocs对于我们公司的项目。作为初学者,我认为我应该为我们的指令之一设置一个示例。 我有 ngdocs 这样工作,它生成文档等等。我想知道的是,在使用 ngdocs 时应该如何为指
如何修改 grunt-ngDocs 生成的网站的外观模板? ? 最终目标是将生成的文档集成到网站中。 例如,我们要为每个主题显示以下选项卡 演示(专注于最终用户呈现) 代码(给开发者) 为此,我们需要
我正在编写一个 AngularJS 组件,我想知道将 ngdoc 注释添加到组件本身和 Controller 函数的正确方法是什么。 你有什么例子吗? 最佳答案 这里有一个例子: controller
我是代码文档的新手,并尝试使用 grunt-ngdocs 记录我的 Angular 应用程序。 我从以下位置克隆了一个工作示例:https://github.com/m7r/grunt-ngdocs-
我使用 grunt grunt-ngdocs 模块,这是创建文档的代码。 ngdocs: { all: app_files, scripts: ['an
我想将 ngdoc 文档添加到 Angular 服务中的函数声明中。如何在下面的示例中为 myFunction 执行此操作? 我认为我需要像 @closure、@functionOf 或 @funct
我正在尝试使用 ngdocs 和 grunt 记录我的 Angular WebApp。我想知道有没有一种方法可以记录路由配置,因为我觉得我的 WebApp 路由系统相当复杂,它的文档部分需要一些注意。
我正在使用 grunt-ngDocs 生成我的 API 文档.我在使用包含使用 ngAnimate 的动画的示例时遇到问题。我在脚本选项中包含了 angular-animate 脚本(根据 ngdoc
给定一个带有返回类的工厂的 Angular 应用程序,如下所示: angular.module('fooApp').factory('User', function(){ function U
我有一个带有一些文档的服务,但是当我尝试使用 grunt-ngdocs 构建文档时,它失败了: Warning: Don't know how to format @ngdoc: method Use
我想记录我正在处理的一个 Angular 项目。我尝试了 grunt-ngdocs。它看起来简单,配置更少,初始试验看起来不错且很有前途。但是我找不到关于其完整用法的好资源。该工具的有限文档令人困惑。
我目前正在记录我的第一个真正的 AngularJs 应用程序,因为我正在使用 ngdocs 语法和 grunt-ngdocs 我想知道是否有更好的方法来注释我的服务方法返回一个 promise (所以
我所有的 js 文件都有文档,我的文档存在于以下文件夹结构中: myapplication/js/controllers/samplecontroller.js myapplication/js/di
我正在尝试通过 grunt-ngdocs 创建 API 文档。部分已创建,但 index.html 没有正确的链接。 我的 gruntfile.js 中有: module.exports = func
我对 Angular 2 有一些经验,但我对框架还是比较陌生。环顾四周,我发现了一个叫做 ngdocs 的东西。这非常好,因为它会根据代码中的注释为您创建一种文档/wiki 区域。 (类似于 js 文
我是一名优秀的程序员,十分优秀!