@@ -6,7 +6,8 @@ import {MemberDoc} from 'dgeni-packages/typescript/api-doc-types/MemberDoc';
6
6
import { getInheritedDocsOfClass } from '../common/class-inheritance' ;
7
7
import {
8
8
decorateDeprecatedDoc ,
9
- getDirectiveSelectors ,
9
+ getSelectors ,
10
+ isComponent ,
10
11
isDirective ,
11
12
isMethod ,
12
13
isNgModule ,
@@ -22,7 +23,7 @@ import {
22
23
CategorizedPropertyMemberDoc ,
23
24
CategorizedTypeAliasExportDoc ,
24
25
} from '../common/dgeni-definitions' ;
25
- import { getDirectiveMetadata } from '../common/directive-metadata' ;
26
+ import { getMetadata } from '../common/directive-metadata' ;
26
27
import { normalizeFunctionParameters } from '../common/normalize-function-parameters' ;
27
28
import { isPublicDoc } from '../common/private-docs' ;
28
29
import { getInputBindingData , getOutputBindingData } from '../common/property-bindings' ;
@@ -111,7 +112,7 @@ export class Categorizer implements Processor {
111
112
// clauses for the Dgeni document. To make the template syntax simpler and more readable,
112
113
// store the extended class in a variable.
113
114
classDoc . extendedDoc = classDoc . extendsClauses [ 0 ] ? classDoc . extendsClauses [ 0 ] . doc ! : undefined ;
114
- classDoc . directiveMetadata = getDirectiveMetadata ( classDoc ) ;
115
+ classDoc . metadata = getMetadata ( classDoc ) ;
115
116
classDoc . inheritedDocs = getInheritedDocsOfClass ( classDoc , this . _exportSymbolsToDocsMap ) ;
116
117
117
118
classDoc . methods . push (
@@ -134,10 +135,15 @@ export class Categorizer implements Processor {
134
135
}
135
136
136
137
// Categorize the current visited classDoc into its Angular type.
137
- if ( isDirective ( classDoc ) && classDoc . directiveMetadata ) {
138
+ if ( ( isDirective ( classDoc ) || isComponent ( classDoc ) ) && classDoc . metadata ) {
139
+ if ( isComponent ( classDoc ) ) {
140
+ classDoc . isComponent = true ;
141
+ } else {
142
+ classDoc . isDirective = true ;
143
+ }
138
144
classDoc . isDirective = true ;
139
- classDoc . directiveExportAs = classDoc . directiveMetadata . get ( 'exportAs' ) ;
140
- classDoc . directiveSelectors = getDirectiveSelectors ( classDoc ) ;
145
+ classDoc . exportAs = classDoc . metadata . get ( 'exportAs' ) ;
146
+ classDoc . selectors = getSelectors ( classDoc ) ;
141
147
} else if ( isService ( classDoc ) ) {
142
148
classDoc . isService = true ;
143
149
} else if ( isNgModule ( classDoc ) ) {
@@ -190,17 +196,17 @@ export class Categorizer implements Processor {
190
196
191
197
const metadata =
192
198
propertyDoc . containerDoc . docType === 'class'
193
- ? ( propertyDoc . containerDoc as CategorizedClassDoc ) . directiveMetadata
199
+ ? ( propertyDoc . containerDoc as CategorizedClassDoc ) . metadata
194
200
: null ;
195
201
196
202
const inputMetadata = metadata ? getInputBindingData ( propertyDoc , metadata ) : null ;
197
203
const outputMetadata = metadata ? getOutputBindingData ( propertyDoc , metadata ) : null ;
198
204
199
- propertyDoc . isDirectiveInput = ! ! inputMetadata ;
200
- propertyDoc . directiveInputAlias = ( inputMetadata && inputMetadata . alias ) || '' ;
205
+ propertyDoc . isInput = ! ! inputMetadata ;
206
+ propertyDoc . inputAlias = ( inputMetadata && inputMetadata . alias ) || '' ;
201
207
202
- propertyDoc . isDirectiveOutput = ! ! outputMetadata ;
203
- propertyDoc . directiveOutputAlias = ( outputMetadata && outputMetadata . alias ) || '' ;
208
+ propertyDoc . isOutput = ! ! outputMetadata ;
209
+ propertyDoc . outputAlias = ( outputMetadata && outputMetadata . alias ) || '' ;
204
210
}
205
211
206
212
/**
0 commit comments