angular-jsdoc
angular-jsdoc copied to clipboard
How to document events?
How to document events with cross-links, '@fires', '@listens', etc.?
At this time I have a [partial] fix for this in the template. I can create a pull request and ask the author to pull it in.
For the time being you can create a custom template and modify html/class.html and insert this code (i put this above the "Members" subsection title because it's a copy of the "Members" template code.
<div class="events" ht-if="children.event">
<h3 class="subsection-title">Events</h3>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr ht-repeat="event in children.event">
<td class="name" nowrap>{{ event.name }}</td>
<td class="type" nowrap>{{ event.eventType }}</td>
<td class="description last">{{ event.description }}</td>
</tr>
</tbody>
</table>
<br />
<br />
</div>
Now the Events template code above works with a doc block like this (right now I don't have one for @fires).
/**
* @ngdoc event
* @event Simpl.Entities.$userEntity#onUserUpdated
* @name Simpl.Entities.$userEntity#onUserUpdated
* @description Broadcasts the updated user object to the root scope.
* @eventof Simpl.Entities.$userEntity
* @eventType broadcast
*/
@allenhwkim See the above comment. If I create a pull request this week do you have an ETA on when you could review and merge it?
Just submit the PR. I’ll review it in case @allenhwkim doesn’t have time.
@Zemke Should the change to support @fires, @listens and @event be made to both templates or just the angular-template?
I have made angular-template for the convenience and I thought it was cool to have html-based template. However, if no one sees the benefit, I am open to drop it for the sake of maintenance.
@Zemke thanks for your support for this. I really appreciate it.
@allenhwkim I like the way the angular-template works with the angular-like templating engine. If anything I would say deprecate/drop the "default" template or make the angular-template the "default" and git rid of what is now known as "default". Trying to keep two completely different templates up to date is extra overhead.
I'm in the process of creating a PR to add support for @event, @listens and @fires.
@Zemke I already have a branch that adds this functionality. I will create a PR for this today.
Any movement on this?