Added support for properties in documentation

This commit is contained in:
Misko Hevery 2011-04-20 13:44:34 -07:00
parent 8cad231bd2
commit f9f95879f0
2 changed files with 25 additions and 0 deletions

View file

@ -543,6 +543,20 @@ describe('ngdoc', function(){
expect(dom).toContain('var modelValue = angular.formatter.myFormatter.parse(userInputString, a);');
});
});
describe('property', function(){
it('should format', function(){
var doc = new Doc({
ngdoc:'property',
name:'myProp',
returns:{type: 'type', description: 'description'}
});
doc.html_usage_property(dom);
expect(dom).toContain('myProp');
expect(dom).toContain('type');
expect(dom).toContain('description');
});
});
});
});

View file

@ -321,6 +321,17 @@ Doc.prototype = {
});
},
html_usage_property: function(dom){
var self = this;
dom.h('Usage', function(){
dom.code(function(){
dom.text(self.name);
});
self.html_usage_returns(dom);
});
},
html_usage_directive: function(dom){
var self = this;
dom.h('Usage', function(){