Skip to content

Commit 9e11fcb

Browse files
authored
test(angular): fixing over-import of RouterModule in the standalone router-link test (#30285)
Issue number: resolves internal --------- <!-- 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. --> Currently the standalone test app for router-link in Angular imports all of `RouterModule` when it only needs to import `RouterLink` from `@angular/router` ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> Now, the Angular test app will import only what it needs from router instead of over-importing. ## 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. --> This PR helps align our Angular test apps with a more real-world implementation expectation
1 parent 21f49b0 commit 9e11fcb

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { Component } from '@angular/core';
2-
import { RouterModule } from '@angular/router';
3-
import { IonRouterOutlet, IonApp } from '@ionic/angular/standalone';
2+
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
43

54
@Component({
65
selector: 'app-root-standalone',
76
templateUrl: './app.component.html',
87
standalone: true,
9-
imports: [RouterModule, IonRouterOutlet, IonApp]
8+
imports: [IonRouterOutlet, IonApp]
109
})
1110
export class AppComponent {
1211
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Component } from '@angular/core';
2-
import { RouterModule } from '@angular/router';
2+
import { RouterLink } from '@angular/router';
33
import { IonRouterLink, IonRouterLinkWithHref } from '@ionic/angular/standalone';
44

55
@Component({
66
selector: 'app-router-link',
77
templateUrl: './router-link.component.html',
88
standalone: true,
9-
imports: [RouterModule, IonRouterLink, IonRouterLinkWithHref],
9+
imports: [RouterLink, IonRouterLink, IonRouterLinkWithHref],
1010
})
1111
export class RouterLinkComponent {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { Component } from "@angular/core";
2-
import { RouterModule } from "@angular/router";
32

43
import { IonicModule } from '@ionic/angular';
54

65
@Component({
76
selector: 'app-standalone',
87
templateUrl: './standalone.component.html',
98
standalone: true,
10-
imports: [IonicModule, RouterModule]
9+
imports: [IonicModule]
1110
})
1211
export class StandaloneComponent { }

0 commit comments

Comments
 (0)