Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #22 from perploug/master
Browse files Browse the repository at this point in the history
feat(ngdocs): @param support for object properties 

@param {Object} param Some obj
@param {String} param.name some name on the obj

Object properties are not included in the method signature
  • Loading branch information
m7r committed Jul 19, 2013
2 parents d0f488c + 5e3c402 commit d7729d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ Doc.prototype = {
optional: optional,
'default':match[5]
};

//if param name is a part of an object passed to a method
//mark it, so it's not included in the rendering later
if(param.name.indexOf(".") > 0){
param.isProperty = true;
}

self.param.push(param);
} else if (atName == 'returns' || atName == 'return') {
match = text.match(/^\{([^}]+)\}\s+(.*)/);
Expand Down Expand Up @@ -671,7 +678,9 @@ Doc.prototype = {
if (self.methods.length) {
dom.div({class:'member method'}, function(){
dom.h('Methods', self.methods, function(method){
var signature = (method.param || []).map(property('name'));
//filters out .IsProperty parameters from the method signature
var signature = (method.param || []).filter(function(e) { return e.isProperty !== true}).map(property('name'));

dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function() {
dom.html(method.description);
method.html_usage_parameters(dom);
Expand Down

0 comments on commit d7729d0

Please sign in to comment.