angular-jsdoc icon indicating copy to clipboard operation
angular-jsdoc copied to clipboard

$rootScope in @name create duplicate members

Open lcaprini opened this issue 8 years ago • 4 comments

Hi, first of all thank you for your awesome plugin! I'm trying to add your specific tags in my jsDoc documentation, but I have a strange behaviour.

If I use $rootScope in @name tag before AngularJS run function, jsDoc automatically add all members founded in all source.

 * Foo Description
 *
 * @memberof Foo
 * @ngdoc Globals
 * @name $rootScope
 */
angular.module("Foo").run(["$rootScope", ..., function($rootScope, ...){ 
...

$rootScope.memberA = false;
$rootScope.memberB = {};

This is awesome and useful, but if there is a redefinition of a member in one of the source files jsDoc duplicate it in Foo members section.

Do you have an idea of I can exclude all redefinition of a member?

Thank you

lcaprini avatar Aug 31 '16 12:08 lcaprini

Can you post more code, specifically the code that you expect to not be redefined?

reloaded avatar Aug 31 '16 22:08 reloaded

As you can see in my module run I have $rootScope.memberA = false and $rootScope.memberB = {}. After using jsdoc in my documentation page appears a Globals section with $rootScope item; inside this I have a the Members table with two rows:

Name Type Description
memberA
memberB

So, jsodc automatically detect memberA and memberB as @memberof $rootScope: it ok.

The problem occurs when I also have $rootScope.memberA = true in one controller (or service, ...); I'd like the docs remain as before, instead I have:

Name Type Description
memberA
memberA
memberB

Seems that angular-jsdoc (o jsDoc) doesn't check if a member is already defined and added to documentation.

Thank you

lcaprini avatar Sep 02 '16 07:09 lcaprini

Try to replace @name $rootscope with @alias $rootscope instead.

reloaded avatar Sep 02 '16 09:09 reloaded

If I replace @name with @alias the item $rootScope disappear from Globals section.

lcaprini avatar Sep 02 '16 09:09 lcaprini