Angular Modernizer
    Preparing search index...
    • Parses a single Angular template with @angular/compiler and reports where a selector, pipe, class member, or input/output binding is used.

      Parameters

      • content: string

        Raw template text.

      • query: TemplateQuery

        What to look for.

      Returns TemplateHit[]

      Hits ordered by offset. Returns [] when the template cannot be parsed at all.

      Pure function over template text; it knows nothing about ts-morph. The project-level lookup (which templates belong to which class, selector and pipe resolution) lives in TemplateUsageFinder. Positions are offsets into the template text so callers can map them to external .html files or to inline template: literals.

      const hits = scanTemplate('<app-user (saved)="onSave()"></app-user>', {
      selector: 'app-user',
      memberName: 'onSave',
      });
      // [{ kind: 'element', ... }, { kind: 'method-call', implicitReceiver: true, ... }]