Aalexbit-codemod

angularjs-template-patterns

Mine AngularJS template patterns (ng-repeat, filters, ng-include, one-time bindings); read-only metrics

miningmetricsangularjscode-miningmigration-assessmenttemplate_pattern
PRO
0 executions

Run locally

npx codemod angularjs-template-patterns

This is a Pro codemod. Preview changes and insights for free, no login or code sharing required. Applying changes and accessing insights requires a paid plan and sign in.Learn more

angularjs-template-patterns

Read-only mining codemod that scans AngularJS HTML templates and emits a template_pattern
metric describing legacy template patterns relevant to an Angular migration assessment. It
never modifies files — every match is reported via codemod:metrics and the transform always
returns null.

What it detects

PatternAutomationRisk
ng-repeat (incl. ng-repeat-start/-end)fulllow
ng-iffulllow
ng-switch / ng-switch-when / ng-switch-defaultfulllow
ng-include with a static template URL (attribute or <ng-include> element)partialmedium
filter{{ expr | someFilter }} interpolationpartialmedium
one-time-binding:: inside {{ }} or in a bare ng-* directive expressionfulllow
dynamic-templateng-include whose template URL is a computed expression, not a literalmanualhigh

Metric cardinality

Each finding increments template_pattern with:

ts

Installation

bash

Development

bash

License

MIT

Ready to contribute?

Build your own codemod and share it with the community.