Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 :

Don't know how to format @ngdoc: provider

I hav look on ngRoute module of angular and they use this syntax. I really dont understand...

And one thing more, on angular documentation they use @ngdoc module, i need to use object instead. I think i use the wrong ngdoc npm module but its the last version i found...

Thank you if you can help me!

PS: I use npm module grunt-ngdocs, if you want my task options ask me.

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

/**
* @ngdoc provider
* @name App.provider:AppConfigProvider
*/
.provider('AppConfig', function ()
{
   //Some stuff
});
like image 253
fromScratch Avatar asked Sep 29 '22 19:09

fromScratch


1 Answers

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. 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'.

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
     */
like image 99
Adi Dahan Avatar answered Oct 06 '22 02:10

Adi Dahan