File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export interface CategorizedClassDoc extends ClassExportDoc {
32
32
isDeprecated : boolean ;
33
33
directiveExportAs ?: string | null ;
34
34
directiveSelectors ?: string [ ] ;
35
- extendedDocs : ClassLikeExportDoc [ ] ;
35
+ extendedDoc : ClassLikeExportDoc | null ;
36
36
}
37
37
38
38
export interface CategorizedPropertyMemberDoc extends PropertyMemberDoc {
@@ -90,11 +90,10 @@ export class Categorizer implements Processor {
90
90
classDoc . methods . sort ( sortCategorizedMembers ) ;
91
91
classDoc . properties . sort ( sortCategorizedMembers ) ;
92
92
93
- // Filter the extends clauses for clauses with an associated Dgeni document. Clauses without
94
- // a document are unknown and should not be mentioned in the documentation for this class.
95
- classDoc . extendedDocs = classDoc . extendsClauses
96
- . filter ( clause => clause . doc )
97
- . map ( clause => clause . doc ! ) ;
93
+ // Classes can only extend a single class. This means that there can't be multiple extend
94
+ // clauses for the Dgeni document. To make the syntax simpler and more readable, store the
95
+ // extended class in a variable.
96
+ classDoc . extendedDoc = classDoc . extendsClauses [ 0 ] ? classDoc . extendsClauses [ 0 ] . doc ! : null ;
98
97
99
98
// Categorize the current visited classDoc into its Angular type.
100
99
if ( isDirective ( classDoc ) ) {
Original file line number Diff line number Diff line change 1
1
< h4 class ="docs-api-h4 docs-api-class-name ">
2
2
< code > {$ class.name $}</ code >
3
+ {% if class.extendedDoc %}
4
+ < span class ="docs-api-class-extends-clauses ">
5
+ < span class ="docs-api-class-extends-label "> extends</ span >
6
+ < span class ="docs-api-class-extends-type "> {$ class.extendedDoc.name $}</ span >
7
+ </ span >
8
+ {% endif %}
3
9
</ h4 >
4
10
5
11
{%- if class.description -%}
6
12
< p class ="docs-api-class-description "> {$ class.description | safe $}</ p >
7
13
{%- endif -%}
8
14
9
- {% if class.extendedDocs.length %}
10
- < p class ="docs-api-class-extends-clauses ">
11
- < span class ="docs-api-class-extends-label "> Extends:</ span >
12
- {% for extendedDoc in class.extendedDocs %}
13
- < span class ="docs-api-class-extends-type "> {$ extendedDoc.name $}</ span >
14
- {% endfor %}
15
- </ p >
16
- {% endif %}
17
-
18
15
{%- if class.directiveSelectors -%}
19
16
< p class ="docs-api-directive-selectors ">
20
17
< span class ="docs-api-class-selector-label "> Selector:</ span >
You can’t perform that action at this time.
0 commit comments