Skip to content

Migrate HTML templates to Angular's new control flow syntax (@if/@else/@for)#2199

Merged
rmroot merged 3 commits intoissue-2179from
copilot/update-html-files-angular-syntax
Jan 13, 2026
Merged

Migrate HTML templates to Angular's new control flow syntax (@if/@else/@for)#2199
rmroot merged 3 commits intoissue-2179from
copilot/update-html-files-angular-syntax

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 13, 2026

Updates 7 HTML component templates to use Angular's new block syntax (@if, @else, @for) replacing deprecated structural directives (*ngIf, [ngIf], *ngFor) and template references (ng-template, ng-container).

Files Modified

  • account-savings-report.component.html - 35 conditions, complex nested templates
  • facility-savings-report-results.component.html - 42 conditions, @for loops
  • emissions-data-form.component.html - 7 conditions, @for loops with indices
  • e-grid-emissions-table.component.html - 9 conditions, @for loops
  • group-monthly-analysis-report.component.html - 15 conditions, nested blocks

Example Conversion

Before:

<ng-container *ngIf="facilityReport && calculating != true">
  <ng-template [ngIf]="!print" [ngIfElse]="printBlock">
    <div class="scroll-x">
      <app-table *ngIf="annualAnalysisSummaries" [data]="data"></app-table>
    </div>
  </ng-template>
  <ng-template #printBlock>
    <app-table *ngIf="settings | includeTable: 'consumption'" [block]="'consumption'"></app-table>
  </ng-template>
</ng-container>

After:

@if (facilityReport && calculating != true) {
  @if (!print) {
    <div class="scroll-x">
      @if (annualAnalysisSummaries) {
        <app-table [data]="data"></app-table>
      }
    </div>
  } @else {
    @if (settings | includeTable: 'consumption') {
      <app-table [block]="'consumption'"></app-table>
    }
  }
}

Note: ng-container elements using *ngTemplateOutlet are preserved as they remain valid for template projection.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.sheetjs.com
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install --legacy-peer-deps --omit=optional (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Update the following html files to use angulars new block syntax with @if and @else. Replace all *ngIf and [ngIf], template and container usages.

account-savings-report.component.html
facility-savings-report-results.component.html
emissions-data-form.component.html
e-grid-emissions-table.component.html
utility-meter-data-filter.component.html
edit-predictor-form.component.html
group-monthly-analysis-report.component.html


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update HTML files to use Angular's new block syntax Migrate HTML templates to Angular's new control flow syntax (@if/@else/@for) Jan 13, 2026
Copilot AI requested a review from rmroot January 13, 2026 14:50
@rmroot rmroot marked this pull request as ready for review January 13, 2026 14:56
@rmroot rmroot merged commit 48004f7 into issue-2179 Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants