Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Component, VERSION } from '@angular/core';
import { RouterLink } from '@angular/router';
import { IonContent, IonHeader, IonItem, IonLabel, IonList, IonRouterLink, IonTitle, IonToolbar } from '@ionic/angular';

/**
* Only the standalone bootstrap renders this page, so it can't rely on
* AppModule's IonicModule scope. These imports register the custom elements.
*/
@Component({
selector: 'app-landing',
templateUrl: './app-landing.component.html',
standalone: false
standalone: true,
imports: [RouterLink, IonRouterLink, IonContent, IonHeader, IonItem, IonLabel, IonList, IonTitle, IonToolbar],
})
export class AppLandingComponent {
angularVersion = VERSION;
Expand Down
3 changes: 1 addition & 2 deletions packages/angular/test/base/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { RouteReuseStrategy } from '@angular/router';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular/lazy';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { AppLandingComponent } from './app-landing/app-landing.component';
import { ModeSwitcherComponent } from './mode-switcher.component';

const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
Expand All @@ -15,7 +14,7 @@ export function ionicConfigFactory(): any {
}

@NgModule({
declarations: [AppComponent, AppLandingComponent],
declarations: [AppComponent],
imports: [
BrowserModule,
AppRoutingModule,
Expand Down
8 changes: 6 additions & 2 deletions packages/angular/test/base/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { Routes } from '@angular/router';
import { AppLandingComponent } from './app-landing/app-landing.component';

export const routes: Routes = [
/**
* Has to load lazily. The lazy app bootstraps from this same route table, and
* eagerly pulling in a standalone component races its custom element
* registration against the lazy loader's.
*/
{
path: '',
pathMatch: 'full',
component: AppLandingComponent
loadComponent: () => import('./app-landing/app-landing.component').then(c => c.AppLandingComponent)
},
{
path: 'lazy',
Expand Down
Loading