grunt-ngdoc is not rendering examples for my ngdoc documentation

384 views Asked by At

I'm trying to get a basic example to work using ngDoc for my Angular project.

Here is an example:

/**
 * @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>
 */

When the documentation is compiled the example title is shown but there is no embedded example.

Here is a link to the compiled documentation:

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

Here's a link to Angular documentation showing what an example should look like:

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

I can't what's wrong with my ngDoc?

1

There are 1 answers

1
Anton On BEST ANSWER

Try to replace name attribute in example tag by module attribute

/**
 * @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>
 */

And don't forget to add pathes to this module and directive to your Gruntfile