Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Document a constant using ngDoc

How would one go about documenting a constant using ngDoc? I don't see any angular specific documentation for documenting values registered with .constant, and the jsDoc syntax for constants doesn't seem to generate any actual docs when it's run through ngDoc.

Ex:

/** * @constant * @name WHITE * * @description * The color white! **/ module.constant( 'WHITE', '#fff' );

like image 504
dherman Avatar asked Aug 06 '14 15:08

dherman


1 Answers

ngDocs currently doesn't provide a way to document constants. As you can see in its templating source code. There isnt relevant html_usage_* method.

I document constants like this, it shows a APP_CONFIG as a module then.

/**
 * @ngdoc object
 * @name APP_CONFIG
 * @description
 *   constant...
 * @example
 * APP_CONFIG is injectable as constant (as a service even to .config())
 * <pre>
 * (...)    .config(function ($APP_CONFIG) {
 * </pre>
 */
like image 90
zbycz Avatar answered Sep 27 '22 16:09

zbycz