简体   繁体   English

NgDocs提供商如何使用它?

[英]NgDocs Provider How use it?

I work on a documentation for a framework on my team and i want to add provider. 我在我的团队的框架文档上工作,我想添加提供程序。 When i add @ngdoc provider it say to me : 当我添加@ngdoc提供者时,它对我说:

Don't know how to format @ngdoc: provider 不知道如何格式化@ngdoc:provider

I hav look on ngRoute module of angular and they use this syntax. 我看看角度的ngRoute模块,他们使用这种语法。 I really dont understand... 我真的不明白......

And one thing more, on angular documentation they use @ngdoc module, i need to use object instead. 还有一点,在使用@ngdoc模块的角度文档中,我需要使用对象。 I think i use the wrong ngdoc npm module but its the last version i found... 我想我使用了错误的ngdoc npm模块,但它是我找到的最后一个版本...

Thank you if you can help me! 谢谢你能帮助我!

PS: I use npm module grunt-ngdocs, if you want my task options ask me. PS:我使用npm模块grunt-ngdocs,如果你想让我的任务选项问我。

/**
* @ngdoc object // module ?
* @name App
*/
"use strict";
angular.module('App', [])

/**
* @ngdoc provider
* @name App.provider:AppConfigProvider
*/
.provider('AppConfig', function ()
{
   //Some stuff
});

This is a late response, but I've just figured it out myself so I thought someone else might find this useful. 这是一个迟到的回应,但我只是想出了自己,所以我认为其他人可能会觉得这很有用。

I've configured two JSDoc blocks in my service.js file. 我在service.js文件中配置了两个JSDoc块。 One was used for the actual service methods, and the other was used for the provider. 一个用于实际的服务方法,另一个用于提供者。

If you configure it like the example below, in your generated HTML file, you'll see the service name that will contain whatever you used with 'servicename', and small cogs icon right of the service name, and that will contain whatever you used with 'servicenameProvider'. 如果您像下面的示例一样配置它,在生成的HTML文件中,您将看到服务名称,其中包含您使用'servicename'的任何内容,以及服务名称右边的小齿轮图标,并且包含您使用的任何内容与'servicenameProvider'。

I think I've explained it a bit messy, but I hope you got the point. 我想我已经解释得有点凌乱,但我希望你明白这一点。

    /**
     * @ngdoc service
     * @module app
     * @name servicename
     * @description
     * Service description
     */

    /**
     * @ngdoc service
     * @module app
     * @name servicenameProvider
     * @description
     * Service description
     */

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM