From 94b761a3f0bcfe7d7c7f3139578f673f4a555572 Mon Sep 17 00:00:00 2001 From: Vicki League Date: Wed, 25 Jun 2025 14:48:13 -0400 Subject: [PATCH] finish migrating breadcrumbs --- .../src/breadcrumbs/breadcrumb.component.html | 2 +- .../src/breadcrumbs/breadcrumb.component.ts | 22 +++---------------- .../breadcrumbs/breadcrumbs.component.html | 21 ++++++++---------- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/libs/components/src/breadcrumbs/breadcrumb.component.html b/libs/components/src/breadcrumbs/breadcrumb.component.html index 28a93134496..b0334f1ac09 100644 --- a/libs/components/src/breadcrumbs/breadcrumb.component.html +++ b/libs/components/src/breadcrumbs/breadcrumb.component.html @@ -1,5 +1,5 @@ - @if (icon) { + @if (icon(); as icon) { } diff --git a/libs/components/src/breadcrumbs/breadcrumb.component.ts b/libs/components/src/breadcrumbs/breadcrumb.component.ts index c40c527d5e4..9c6d8146672 100644 --- a/libs/components/src/breadcrumbs/breadcrumb.component.ts +++ b/libs/components/src/breadcrumbs/breadcrumb.component.ts @@ -1,15 +1,7 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore -import { - Component, - EventEmitter, - Input, - Output, - TemplateRef, - ViewChild, - input, -} from "@angular/core"; +import { Component, EventEmitter, Output, TemplateRef, ViewChild, input } from "@angular/core"; import { QueryParamsHandling } from "@angular/router"; @Component({ @@ -17,17 +9,9 @@ import { QueryParamsHandling } from "@angular/router"; templateUrl: "./breadcrumb.component.html", }) export class BreadcrumbComponent { - // TODO: Skipped for migration because: - // This input is used in a control flow expression (e.g. `@if` or `*ngIf`) - // and migrating would break narrowing currently. - @Input() - icon?: string; + readonly icon = input(); - // TODO: Skipped for migration because: - // This input is used in a control flow expression (e.g. `@if` or `*ngIf`) - // and migrating would break narrowing currently. - @Input() - route?: string | any[] = undefined; + readonly route = input(undefined); readonly queryParams = input>({}); diff --git a/libs/components/src/breadcrumbs/breadcrumbs.component.html b/libs/components/src/breadcrumbs/breadcrumbs.component.html index 9413fb62549..820b100afd3 100644 --- a/libs/components/src/breadcrumbs/breadcrumbs.component.html +++ b/libs/components/src/breadcrumbs/breadcrumbs.component.html @@ -1,17 +1,16 @@ @for (breadcrumb of beforeOverflow; track breadcrumb; let last = $last) { - @if (breadcrumb.route) { + @if (breadcrumb.route(); as route) { - } - @if (!breadcrumb.route) { + } @else { @for (breadcrumb of overflow; track breadcrumb) { - @if (breadcrumb.route) { + @if (breadcrumb.route(); as route) { - } - @if (!breadcrumb.route) { + } @else { @@ -59,19 +57,18 @@ @for (breadcrumb of afterOverflow; track breadcrumb; let last = $last) { - @if (breadcrumb.route) { + @if (breadcrumb.route(); as route) { - } - @if (!breadcrumb.route) { + } @else {