mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-24 22:03:43 +00:00
docs should print usage for services that are functions
This commit is contained in:
parent
f00b157841
commit
f3a39a6418
1 changed files with 16 additions and 0 deletions
|
|
@ -432,9 +432,25 @@ Doc.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
html_usage_service: function(dom){
|
html_usage_service: function(dom){
|
||||||
|
var self = this;
|
||||||
dom.h('Description', this.description, dom.html);
|
dom.h('Description', this.description, dom.html);
|
||||||
dom.h('Dependencies', this.requires);
|
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){
|
dom.h('Methods', this.methods, function(method){
|
||||||
var signature = (method.param || []).map(property('name'));
|
var signature = (method.param || []).map(property('name'));
|
||||||
dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function(){
|
dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function(){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue