3,764 questions
2
votes
1
answer
130
views
angular 20 children routes seems not loaded at all when lazy load of component enabled
I have main route:
{
path: 'signup',
loadComponent: () => import('./signup/signup.component').then(m => m.SignUpComponent),
children: signUpRoutes
},
and inside signUpRoutes I ...
1
vote
0
answers
78
views
Directly access a child route by copying and pasting a URL from outside the app
The url: http://www.example.com/#/orders/new/today/3640963 shows me the 'new tab', with the order details view open.
This is when I click to it in the app. If I copy that URL and paste it in a new ...
3
votes
1
answer
252
views
Angular 17 Module to Standalone Conversion. How should I setup main.ts or app.config.ts?
I'm trying to change my Angular 17 project to be a standalone project. But some of the fundamental files are different than how they are defined in tutorials and other people's projects. I didn't have ...
2
votes
1
answer
106
views
Navigation to home page from login page is not working the second time
By default, the login page opens if the user is logged out. The onLogin method works fine the first time and navigates to the home page. On logout, it navigates back to the login page. If I try to log ...
1
vote
1
answer
211
views
Angular Library Routing Not Working When Used Inside Angular 19 App
I'm working on an Angular 19 app that uses a custom Angular library, and I'm having trouble getting the routing inside the library to work properly.
The app is a legacy app and all the components are ...
1
vote
2
answers
133
views
How to persist and restore page settings in Angular when navigating between routes?
In my Angular application, users can configure settings on a particular page (e.g., filters, view preferences, etc.). When the user navigates to another route and then returns to the original page, I ...
1
vote
1
answer
81
views
Angular routing - avoid showing two components in router outlet at the same time during enter and leave animations
The problem us basically explained in the title. I have router-outlet and components with :enter and :leave animations. During navigating from one to another both components are in outlet at the same ...
2
votes
1
answer
66
views
NG8001: 'router-outlet' is not a known element: 1. If 'router-outlet' is an Angular component, then verify that it is part of this module
I am getting this error from router-outlet directive. Can anyone please help me why it is occuring as i have no clue. All the imports have been added on app.module.ts file but still its saying that ...
0
votes
2
answers
78
views
How to use a secondary router outlet without ng modules correctly to enable page reload by url?
How to use a secondary router outlet without ng modules correctly enabling page reload by url?
I have an app component with a router:
<main>
<router-outlet></router-outlet>
&...
5
votes
2
answers
2k
views
Angular 19 SSR: The 'detail/:id' route uses prerendering and includes parameters, but 'getPrerenderParams' is missing
I try to build Angular 19 SSR using ng build --configuration production --aot but get the following error:
[ERROR] The 'detail/:id' route uses prerendering and includes parameters, but '...
0
votes
1
answer
61
views
Angular dynamic component loading through a config file
I have a question about angular dynamic component loading through an environment config file.
Below is a sample of my environment file:
routes: [
{
name: 'auth/logout',
path: '../../...
1
vote
1
answer
50
views
Angular Material sidenav + route => default selection
I use in my app the Material Sidebar and navigate with the router. Basically it looks like
<mat-sidenav-container [hasBackdrop]="true" autosize>
<mat-sidenav
(opened)=&...
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: '',
...
1
vote
1
answer
62
views
Routing issue for dynamic pages, not even trying to access component
I am currently attempting to learn Angular and am using an existing API as a back-end.
One of the types of pages is a dynamic news page following the traditional news/news-item-slug pattern.
I am ...
0
votes
0
answers
183
views
Angular 19 + ngx-translate-router: Language not detected from URL, always redirects to /en
Problem
I am using Angular 19 with ngx-translate-router to handle localized routes. However, my app always redirects to /en on startup, even when a different language is present in the URL.
For ...
1
vote
0
answers
221
views
Angular 18 live reload routing issues
Somehow, the live reload (when any code is changed) causes routing issues. I've spent couple of hours investigating this, however couldn't understand what is going on. Here is what happens:
When I ...
1
vote
1
answer
58
views
Detecting if an Angular route came from a child/sub router-outlet
I have an Angular 19 app, and I've added the route transition animations. Docs for that are here: https://angular.dev/guide/animations/route-animations
In my application bootstrap, I have this:
...
0
votes
0
answers
54
views
Wait for component to load before activating any routes in Angular
I my project I'm using map as main element, placed in app.component.html:
<div #gmap style="width: 100%;height: 100%;"></div>
In app.component.ts
@ViewChild('gmap', {static: ...
0
votes
0
answers
42
views
How should I handle the slash in search terms in Spartacus Commerce Cloud?
The official documentation has provided a way to handle the "slash" symbol in product names, by using a PRODUCT_NORMALIZER.
https://sap.github.io/spartacus-docs/adding-and-customizing-routes/...
0
votes
0
answers
208
views
Angular Routing and nginx Configuration – Direct URL Access Returns 404
I'm hosting multiple Angular applications on a Windows machine using nginx. I have a landing page (index.html) that lets me choose between two Angular projects—protocolviewer and conficviewer—which ...
1
vote
1
answer
74
views
Why DI RouterState in standalone app triggers NullInjectorError
I am getting NullInjectorError error in brand new angular app.
I have just generated this app as a standalone angular app (ng new StandaloneApp). In the AppComponent's constructor I have added ...
1
vote
1
answer
816
views
angular routing is not working in angular 19
Why is this routing config not working? The router is trying to go /posts but it should not go to /posts. Currently it is showing a blank page. BlankComponentComponent contains router-outlet and ...
0
votes
1
answer
86
views
Background Video not loading after implementing Lazy Loading in Angular
So, I have been practicing Angular during these days, and I encountered this issue while implementing lazy loading. My video doesn't load; if it does, it is not muted, and after refreshing the webpage,...
2
votes
0
answers
137
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
66
views
default route resolver (Angular)
I'm trying to set some state in our NgRx Store for specific pages (I'll cause these POI - "page of interest"). If not one of those pages, I would like to set the Store to a default value. We ...
1
vote
1
answer
52
views
Change routes when child component activate
I want to do a login page with password reset page. In the page, only a tiny part of the page will change when i click on "reset password" so the view will be like this :
Login page:
<div ...
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 ...
0
votes
1
answer
107
views
Github Pages not recognizing Angular routing
I have a test Angular18 website hosted on Github Pages. I have an About page that works perfectly on my localhost, but came back as 404 not found. I created a 404.html file as suggested in many posts, ...
1
vote
1
answer
192
views
How do I use Angular's inject within a canActivate function?
In the following canActivate function, I need to get the number of Items in a cart. I inject the CartService for this purpose but am getting an error that inject() must be called from an injection ...
1
vote
0
answers
46
views
"Angular HttpClient data inconsistency after page refresh: duplicate or missing entries in list"
I'm working on an Angular project where I display a list of tables at the top of the page. When I click on a table name, I use Angular's HttpClient and ActivatedRoute to fetch the selected table's ...
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, ...
2
votes
3
answers
129
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
}));
...
1
vote
2
answers
687
views
Angular Router - how to destroy old component immediately when routerLink changes
In Angular, after a routerLink triggers a route change, the old component is only destroyed basically at the same time as the new component's initialization:
This is being a problem for me because I ...
1
vote
2
answers
223
views
Angular router.navigateByUrl does not change site content
I am working on client application using newest angular (18). I tried to make the site that after login it redirects to tasks. But when I do navigate, it changes URL and site stays on login page, when ...
1
vote
0
answers
377
views
How to inject RouteReuseStrategy only in specific components?
In my Angular16 standalone app I want to implement a RouteReuseStrategy and add it only to specific components. I found some solutions that implied using some extras (eg https://stackoverflow.com/a/...
0
votes
4
answers
80
views
I am not able to route to another component in angular
<div class="mr-3 ml-3 mt-0 mb-4 leave_card_outer" *ngIf="leaveStatus !=null">
<div class="row bg-white p-2">
<div class="col py-3 ...
3
votes
1
answer
807
views
Children route parameter are not set with withComponentInputBinding
In an Angular 18 application I can not have children route parameter set.
I have a route defined as
export const routes: Routes = [
{ path: 'test',
children: [
{ path: ':operation/:id', ...
1
vote
0
answers
39
views
Two <ion-router-outlet> in same page on XL screens
My app has this page structure:
/home
/menu
/A
/B
/admin
so /menu/A and /menu/B are two distinct pages. Anyway, in very large (XL) screens, I could show both of them side by side. So I want ...
0
votes
1
answer
72
views
Route encoding Angular 12: Routing not working as expected [closed]
Recently upgraded Angular application from version 9 to 12.
Now, my current routes are not working, and encoded to %23.
Here is an example of my routes:
{ path: 'app-terminal-request-list', component: ...
3
votes
2
answers
82
views
How to reload a page indefinitely?
The code below reload a page just once after initial page rendering (loading). It does not reload the page after first reload request was made. I want to know how to reload a page indefinitely. In ...
2
votes
1
answer
144
views
How to maintain query params when redirecting in Angular RoutingModule with redirectTo?
Summary
I want to redirect in my Angular RoutingModule from one path to another while maintaining the query params. However, when the redirect completes, the query params are not present anymore.
The ...
2
votes
0
answers
68
views
Single-page web app accessibility, putting the user in the right place after navigation
I'm working on an Angular application and focusing on accessibility. At the top of the page are "skip to main navigation" and "skip to main content" links. It's been my idea, with ...
0
votes
1
answer
71
views
Angular client side dynamic route redirect to wildcard route on page reload
In angular app I have hundreds of dynamic routes. Which are added in route config after an API call.
But when I reload the same page with dynamic route, browser send the request to server and return ...
2
votes
2
answers
95
views
How to prefix automatically language in path of route with Angular 14
I try to add the language of customer directly in the path like
/en/dashboard
And if a customer go to the web site with an older link, like
/home
I want to add automatically the default language in ...
1
vote
0
answers
235
views
Angular Direct Routing Not Working When Copying and Pasting URL
I'm facing an issue with routing in my Angular application. When I directly copy and paste a URL into the browser (e.g., https://myapp.dev/material-details/bd3d31dd-945a-4faf-a888-be43204d6a85/...
1
vote
2
answers
1k
views
Router-outlet not loading first component as expected
On my new angular project I have the following app.routes.ts file:
import { Route } from '@angular/router';
export const APP_ROUTES: Route[] = [
{
path: 'main',
loadComponent: () =...
1
vote
1
answer
58
views
Migration from Angular version 13 to 14 LoadChildrenCallback issue
loadChildren: () =>
import(/* webpackChunkName: "apc" */ 'advanced-payments-control')
.then((m) => m.AdvancedPaymentsControlModule)
.catch((e) => {
...
1
vote
0
answers
153
views
Firebase dynamic routing failing with ""Invalid Dynamic Link" error" or leading to home page
I could not make Dynamic linking working in an app.
So to keep example as simple as possible, I followed Tour Of Hero example and downloaded the code.
App works locally fine as well as when deployed ...
0
votes
3
answers
253
views
How do I use child routes in angular 17 angular routing
How do I create child routes for a tab page using angular?
app.component.html
<main class="main">
<div class="content container-fluid">
<router-outlet></...
1
vote
1
answer
253
views
CoreUI with Angular 18 - interceptor not intercepting http requests
I just started with coreUi and Angular 18 and would like to intercept the requests, when the user calls another route. I started with the standard coreUi modern theme and set everything up so far but ...