chore(angular): upgrade test apps to latest (#30517)

Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Angular base has outdated files, which has lead to many duplicated files
within the versioned apps. Base files should always be the latest.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Updated base files to the latest
- Removed duplicate files from the versioned apps since base will
provide them
- Added files to the older versioned apps since they no longer align
with the latest files with base

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

N/A
This commit is contained in:
Maria Hutt
2025-06-30 13:10:51 -07:00
committed by GitHub
parent 4b8863b6d6
commit 7b9f306d1f
53 changed files with 235 additions and 724 deletions

View File

@ -4,7 +4,7 @@ import { RouterModule } from '@angular/router';
import { routes } from './app.routes';
@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, { bindToComponentInputs: true })],
exports: [RouterModule]
})
export class AppRoutingModule { }

View File

@ -0,0 +1,44 @@
import { Component } from "@angular/core";
import { IonicModule } from "@ionic/angular"; // Only import IonicModule
import { NavRootComponent } from "./nav-root.component"; // Import the NavRootComponent
@Component({
selector: 'app-modal-nav-params',
template: `
<ion-header>
<ion-toolbar>
<ion-title>Modal Nav Params</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-button id="open">Open Modal</ion-button>
<ion-modal #modal trigger="open">
<ng-template>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button (click)="modal.dismiss()">Close</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-nav [root]="root" [rootParams]="rootParams"></ion-nav>
</ion-content>
</ng-template>
</ion-modal>
</ion-content>
`,
standalone: true,
imports: [IonicModule] // Only import IonicModule here, remove NavRootComponent
})
export class ModalNavParamsComponent {
root = NavRootComponent; // Use the root component in the ion-nav
rootParams = {
params: {
id: 123
}
};
}

View File

@ -0,0 +1,36 @@
import { Component, OnInit } from "@angular/core";
import { IonicModule } from "@ionic/angular";
/**
* This is used to track if any occurrences of
* the ion-nav root component being attached to
* the DOM result in the rootParams not being
* assigned to the component instance.
*
* https://github.com/ionic-team/ionic-framework/issues/27146
*/
let rootParamsException = false;
@Component({
selector: 'app-modal-content',
template: `
{{ hasException ? 'ERROR' : 'OK' }}
`,
imports: [IonicModule]
})
export class NavRootComponent implements OnInit {
params: any;
ngOnInit() {
if (this.params === undefined) {
rootParamsException = true;
}
}
get hasException() {
return rootParamsException;
}
}

View File

@ -1,13 +1,22 @@
import { NgModule } from "@angular/core";
import { RouterModule } from "@angular/router";
import { VersionTestComponent } from "./version-test.component";
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: VersionTestComponent
path: 'modal-nav-params',
loadComponent: () => import('./modal-nav-params/modal-nav-params.component').then(m => m.ModalNavParamsComponent),
},
{
path: 'bind-route/:id',
data: {
title: 'data:bindToComponentInputs'
},
resolve: {
name: () => 'resolve:bindToComponentInputs'
},
loadComponent: () => import('./bind-component-inputs/bind-component-inputs.component').then(c => c.BindComponentInputsComponent)
}
])
],

View File

@ -2,9 +2,14 @@ import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppServerModule } from './app/app.server.module';
if (environment.production) {
enableProdMode();
}
export { AppServerModule } from './app/app.server.module';
export { renderModule, renderModuleFactory } from '@angular/platform-server';
export { renderModule } from '@angular/platform-server';
// Add a default export
export default AppServerModule;