Skip to content

Commit f9f9587

Browse files
committed
Added support for properties in documentation
1 parent 8cad231 commit f9f9587

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

docs/spec/ngdocSpec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,20 @@ describe('ngdoc', function(){
543543
expect(dom).toContain('var modelValue = angular.formatter.myFormatter.parse(userInputString, a);');
544544
});
545545
});
546+
547+
describe('property', function(){
548+
it('should format', function(){
549+
var doc = new Doc({
550+
ngdoc:'property',
551+
name:'myProp',
552+
returns:{type: 'type', description: 'description'}
553+
});
554+
doc.html_usage_property(dom);
555+
expect(dom).toContain('myProp');
556+
expect(dom).toContain('type');
557+
expect(dom).toContain('description');
558+
});
559+
});
546560
});
547561

548562
});

docs/src/ngdoc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,17 @@ Doc.prototype = {
321321
});
322322
},
323323

324+
html_usage_property: function(dom){
325+
var self = this;
326+
dom.h('Usage', function(){
327+
dom.code(function(){
328+
dom.text(self.name);
329+
});
330+
331+
self.html_usage_returns(dom);
332+
});
333+
},
334+
324335
html_usage_directive: function(dom){
325336
var self = this;
326337
dom.h('Usage', function(){

0 commit comments

Comments
 (0)