From f3a39a6418543ac91bfce030275c205783e91e4b Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sun, 6 Feb 2011 21:17:58 -0800 Subject: docs should print usage for services that are functions --- docs/src/ngdoc.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs/src/ngdoc.js') diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 153e6f90..9ca78dc6 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -432,9 +432,25 @@ Doc.prototype = { }, html_usage_service: function(dom){ + var self = this; dom.h('Description', this.description, dom.html); dom.h('Dependencies', this.requires); + if (this.param.length) { + dom.h('Usage', function(){ + dom.code(function(){ + dom.text(self.name.split('.').pop()); + dom.text('('); + self.parameters(dom, ', '); + dom.text(');'); + }); + + self.html_usage_parameters(dom); + self.html_usage_this(dom); + self.html_usage_returns(dom); + }); + } + dom.h('Methods', this.methods, function(method){ var signature = (method.param || []).map(property('name')); dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function(){ -- cgit v1.2.3