componentDecorators: project component decorators in
addition to Component (parser.componentDecorators).
Find Angular symbols matching query.
Selector (e.g. app-user, appHighlight), pipe name
(e.g. dateFormat), class name (e.g. UserComponent), or partial
selector substring.
Optionaltype: AngularSymbolTypeOptional filter; when provided only results of the given type are returned.
Array of matching AngularSymbolResult objects, empty when none
are found.
Finds Angular symbols across all source files in a ts-morph
Project.Symbols are components, directives, pipes, services, guards, interceptors, resolvers, modules and tokens, found by selector, template name, class name, or token name. Supports the standard Angular decorators and the project's own component decorators (
parser.componentDecorators).Remarks
The project must already have the relevant source files added before calling
findSymbol.*.spec.ts/*.test.tsfiles are skipped, like in DirectiveIndex. Library components, directives and pipes (ngx-translate, Angular Material) carry no decorators in their.d.ts; they are read from the compiledɵcmp/ɵdir/ɵpipedeclarations of every declaration file in the program and markedsource: 'library'. Library symbols match exactly (class name, pipe name, or one name of the selector list), not by substring. Queries are matched case-sensitively for class names, and substring-matched for selectors/pipe names (e.g. searching "app-list" also returns "app-list-item" selectors).Example