@@ -6,7 +6,8 @@ import {MemberDoc} from 'dgeni-packages/typescript/api-doc-types/MemberDoc';
66import { getInheritedDocsOfClass } from '../common/class-inheritance' ;
77import {
88 decorateDeprecatedDoc ,
9- getDirectiveSelectors ,
9+ getSelectors ,
10+ isComponent ,
1011 isDirective ,
1112 isMethod ,
1213 isNgModule ,
@@ -22,7 +23,7 @@ import {
2223 CategorizedPropertyMemberDoc ,
2324 CategorizedTypeAliasExportDoc ,
2425} from '../common/dgeni-definitions' ;
25- import { getDirectiveMetadata } from '../common/directive-metadata' ;
26+ import { getMetadata } from '../common/directive-metadata' ;
2627import { normalizeFunctionParameters } from '../common/normalize-function-parameters' ;
2728import { isPublicDoc } from '../common/private-docs' ;
2829import { getInputBindingData , getOutputBindingData } from '../common/property-bindings' ;
@@ -41,7 +42,8 @@ export function categorizer(exportSymbolsToDocsMap: Map<ts.Symbol, ClassLikeExpo
4142 * Processor to add properties to docs objects.
4243 *
4344 * isMethod | Whether the doc is for a method on a class.
44- * isDirective | Whether the doc is for a @Component or a @Directive
45+ * isComponent | Whether the doc is for a @Component
46+ * isDirective | Whether the doc is for a @Directive
4547 * isService | Whether the doc is for an @Injectable
4648 * isNgModule | Whether the doc is for an NgModule
4749 */
@@ -111,7 +113,7 @@ export class Categorizer implements Processor {
111113 // clauses for the Dgeni document. To make the template syntax simpler and more readable,
112114 // store the extended class in a variable.
113115 classDoc . extendedDoc = classDoc . extendsClauses [ 0 ] ? classDoc . extendsClauses [ 0 ] . doc ! : undefined ;
114- classDoc . directiveMetadata = getDirectiveMetadata ( classDoc ) ;
116+ classDoc . metadata = getMetadata ( classDoc ) ;
115117 classDoc . inheritedDocs = getInheritedDocsOfClass ( classDoc , this . _exportSymbolsToDocsMap ) ;
116118
117119 classDoc . methods . push (
@@ -134,10 +136,14 @@ export class Categorizer implements Processor {
134136 }
135137
136138 // Categorize the current visited classDoc into its Angular type.
137- if ( isDirective ( classDoc ) && classDoc . directiveMetadata ) {
139+ if ( isComponent ( classDoc ) && classDoc . metadata ) {
140+ classDoc . isComponent = true ;
141+ classDoc . exportAs = classDoc . metadata . get ( 'exportAs' ) ;
142+ classDoc . selectors = getSelectors ( classDoc ) ;
143+ } else if ( isDirective ( classDoc ) && classDoc . metadata ) {
138144 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 ) ;
141147 } else if ( isService ( classDoc ) ) {
142148 classDoc . isService = true ;
143149 } else if ( isNgModule ( classDoc ) ) {
@@ -190,17 +196,17 @@ export class Categorizer implements Processor {
190196
191197 const metadata =
192198 propertyDoc . containerDoc . docType === 'class'
193- ? ( propertyDoc . containerDoc as CategorizedClassDoc ) . directiveMetadata
199+ ? ( propertyDoc . containerDoc as CategorizedClassDoc ) . metadata
194200 : null ;
195201
196202 const inputMetadata = metadata ? getInputBindingData ( propertyDoc , metadata ) : null ;
197203 const outputMetadata = metadata ? getOutputBindingData ( propertyDoc , metadata ) : null ;
198204
199- propertyDoc . isDirectiveInput = ! ! inputMetadata ;
200- propertyDoc . directiveInputAlias = ( inputMetadata && inputMetadata . alias ) || '' ;
205+ propertyDoc . isInput = ! ! inputMetadata ;
206+ propertyDoc . inputAlias = ( inputMetadata && inputMetadata . alias ) || '' ;
201207
202- propertyDoc . isDirectiveOutput = ! ! outputMetadata ;
203- propertyDoc . directiveOutputAlias = ( outputMetadata && outputMetadata . alias ) || '' ;
208+ propertyDoc . isOutput = ! ! outputMetadata ;
209+ propertyDoc . outputAlias = ( outputMetadata && outputMetadata . alias ) || '' ;
204210 }
205211
206212 /**
0 commit comments