首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >grunt-ngdoc没有为我的ngdoc文档提供示例。

grunt-ngdoc没有为我的ngdoc文档提供示例。
EN

Stack Overflow用户
提问于 2015-10-29 14:37:04
回答 1查看 374关注 0票数 2

我正试图获得一个基本的示例,以便在我的角度项目中使用ngDoc。

下面是一个示例:

代码语言:javascript
复制
/**
 * @ngdoc directive
 * @name ui.components.uiRepeat
 * @description
 *
 * Place this attribute directive on any element that has an `ng-repeat` on it, and it will add CSS classes
 * for the different element states in the repeat set.
 *
 * @example
 <example name="uiRepeat-directive">
 <file name="index.html">
 <div ng-repeat="item in items" ui-repeat="item">
 </div>
 </file>
 </example>
 */

在编译文档时,会显示示例标题,但没有嵌入的示例。

以下是编译后的文档的链接:

http://thinkingmedia.github.io/thinkingmedia-ui/#/api/ui.components.uiRepeat

这里有一个指向角文档的链接,展示了一个示例应该是什么样子:

https://docs.angularjs.org/api/ng/directive/ngClick

我的ngDoc怎么了?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-25 16:42:24

尝试用模块属性替换示例标记中的name属性

代码语言:javascript
复制
/**
 * @ngdoc directive
 * @name ui.components.uiRepeat
 * @description
 *
 * Place this attribute directive on any element that has an `ng-repeat` on it, and it will add CSS classes
 * for the different element states in the repeat set.
 *
 * @example
 <example module="ui">
 <file name="index.html">
 <div ng-repeat="item in items" ui-repeat="item">
 </div>
 </file>
 </example>
 */

不要忘记向这个模块添加路径,并向Gruntfile添加指令

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33417186

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档