Angular Modernizer
    Preparing search index...

    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).

    The project must already have the relevant source files added before calling findSymbol. *.spec.ts / *.test.ts files 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 / ɵpipe declarations of every declaration file in the program and marked source: '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).

    const finder = new AngularSymbolFinder(project);
    const results = finder.findSymbol('app-user');
    // results[0] -> { file, className, angularType: 'component', selector: 'app-user', metadata: {...} }

    const pipes = finder.findSymbol('dateFormat', 'pipe');
    // pipes[0] -> { file, className: 'DateFormatPipe', angularType: 'pipe', pipeName: 'dateFormat', metadata: {...} }
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Find Angular symbols matching query.

      Parameters

      • query: string

        Selector (e.g. app-user, appHighlight), pipe name (e.g. dateFormat), class name (e.g. UserComponent), or partial selector substring.

      • Optionaltype: AngularSymbolType

        Optional filter; when provided only results of the given type are returned.

      Returns AngularSymbolResult[]

      Array of matching AngularSymbolResult objects, empty when none are found.

      // By selector
      finder.findSymbol('app-user');

      // By class name with type filter
      finder.findSymbol('UserService', 'service');