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

Commit

Permalink
chore(ngdocs): reimplement @param isProperty (5e3c402)
Browse files Browse the repository at this point in the history
  • Loading branch information
m7r committed Jan 9, 2014
1 parent eafe65c commit 6ffffe4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ 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 @@ -845,7 +850,8 @@ 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 Expand Up @@ -902,6 +908,7 @@ Doc.prototype = {
var sep = prefix ? separator : '';
(this.param||[]).forEach(function(param, i){
if (!(skipFirst && i==0)) {
if (param.isProperty) { return; }
if (param.optional) {
dom.text('[' + sep + param.name + ']');
} else {
Expand Down

0 comments on commit 6ffffe4

Please sign in to comment.