1,908 questions
1
vote
2
answers
83
views
Prevent navigation to non-existent ID params
I try to prevent user to navigate to a non-existent id parameters with my details component. I read the documentation of Angular v20 and it seems that the "resolvers routes configuring" is ...
0
votes
0
answers
58
views
How to link a ticket to its related object using objectId in Angular when data comes from /api/objects?caseId=...?
I’m building an Angular frontend for an ERP-like system, and I’m trying to generate a link like:
<a [routerLink]="['/erp/real-estates/objects', objectId]">Gå till objekt # som ...
2
votes
1
answer
71
views
Router outlet sibling styling
I've come back to Angular after a long time and am a bit confused. Last time I used angular any routes defined where being rendered as children of router outlet. But now it is being rendered as child ...
1
vote
2
answers
110
views
Unexpected result when unit testing router.navigate's toHaveBeenCalledWith method
Angular: 18.2.13
Jest: 29.7.0
I'm unit testing a method in my component which performs a router.navigate after a successful HTTP call. Note that I've removed some of the unncessary code for brevity
...
2
votes
1
answer
113
views
Multiple <router-outlet> Angular 19
I have a page where I display a material table with a select drop-down to select a category from multiple categories and a search box to filter the table.
I want to give each category in the drop-down ...
1
vote
2
answers
94
views
How can I mix primary and named outlets in nested navigation?
Given the following routes:
export const routes: Routes = [
{ path: "test-1/:name", component: TestComponent, title: "Main 1" },
{ path: "test-2/:name", component: ...
1
vote
1
answer
69
views
How to stay on the same dynamic URL after refreshing the page, angular 19
In my single page angular app I represent the groups data in the tabs, one tab per group, one dynamic url with groupId in it per group tab. During first loading a user gets redirected to the tab of ...
0
votes
1
answer
72
views
I am updating the angular component properties inside a if block and I feel it is not updating
ngOnInit() {
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
if (event.url === '/common/time') {
this.zone.run(() => {
...
1
vote
1
answer
46
views
Angular router activates outlet that is removed
I have dynamically added component with its own router outlet(for child paths):
this.componentRef = this.modal.createComponent(ComponentA);
After removing this component via destroy method:
this....
1
vote
1
answer
53
views
Get routerLink DOM element after clicking without binding (click) event
Let's assume I have something like this in my code:
<button routerLink="/account" routerLinkActive="active">Account</button>
Is there a way to access this element when ...
2
votes
1
answer
50
views
Cannot match children routes of blank path
I have this configuration in my routing in Angular:
...
{
path: 'account',
canActivate: [AuthGuardService],
children: [
{
path: '',
...
0
votes
0
answers
26
views
How to override Angular's Router and ActivatedRoute for query param encryption?
I need to encrypt and decrypt query parameters in an Angular application. My idea is to create wrapper classes around Router and ActivatedRoute to handle encryption before navigation and decryption ...
1
vote
1
answer
35
views
Angular module loading children, child route is not initialising on router.navigate
The app loads app.module where I give it a route:
export const routes: Routes = [
{
path: '',
resolve: { mockData: MockApiResolver },
loadChildren: () => import('./shared-components/...
1
vote
1
answer
770
views
Routes in angular 19 do not change anything in the interface
I have a simple route system in Angular 19, basically it is the home page and an about page that are between a header and a footer. However, despite the URL changing when clicking on the redirect link,...
2
votes
0
answers
140
views
How to disable view transitions for a specific router outlet?
I have enabled view transitions using the withViewTransitions() function in provideRouter().
Now I like to write a directive or something to be able to disable the transition view for a specific <...
1
vote
1
answer
205
views
How to handle small bundles in an Angular app to reduce network overhead?
I’ve noticed that my Angular app generates several small bundles (some as small as 179 bytes, with a few others under 3.1 KB). These small bundles are typically related to routing files or small ...
1
vote
1
answer
137
views
Router does not match route on navigation
I have a HTML code:
<table mat-table [dataSource]="claims" matSort class="mat-elevation-z8">
<ng-container *ngFor="let column of displayedColumns" [...
0
votes
0
answers
214
views
Angular 18 navigation between routes
I'm working with Angular and have implemented a NavigationService to handle routing/navigation in my app. However, i’m experiencing an issue where the navigation does not occur on the first click. I ...
1
vote
0
answers
28
views
how to pass state in default route Angular
i'm facing an issue passing router state to the default child route("general"),
the state is set only when i click on the tab,
FunctionalLocationDetailsComponent is parent component,
...
1
vote
1
answer
46
views
How to eliminate the verbose pattern of canActivate/canDeactivate in Angular?
My routing is set up like this (main parent node with a bunch of child sub nodes).
export const routes: Routes = [
{ path: "", component: HomeComponent },
{ path: "profile", ...
1
vote
1
answer
34
views
Using Common Service Variables or Route Parameters [closed]
I have a Angular application, which has multiple components that access the same Service.
I am trying to understand if there is any benefit to switching away from using route parameters to using ...
2
votes
2
answers
105
views
Underline the selected navitem after open link in new tab
I have a navbar that the selected/active navitem is recognizable by an orange underline. However, when I open another navitem in a new tab (by rightclick), the default navitem is underlined and not ...
1
vote
1
answer
49
views
The parent component will be activated only when the child route is activated
I want a route structure like this:
If I go to the "/sale" route:
dashboard
feature
sale
If I go to the "/" route:
dashboard
That is, if the child route is not activated, ...
0
votes
2
answers
71
views
Common directive to detect for form value before any routing
I need to team suggestion , I have more than 10 form. I want create common directives or any other option form value change before routing. If form changed we need to get confirmation from ...
2
votes
3
answers
130
views
merge two ParamMap angular
I have the following code that works fine:
let urlParameters = combineLatest(
[this.route.params, this.route.queryParams], (params, queryParams) => ({
...params, ...queryParams
}));
...