3,762 questions
2
votes
0
answers
67
views
Angular routing is working fine, but some component template is ignored because of other unlinked component usage
I am facing a very strange behavior in my Angular project. It will be quite challenging for me to fully explain, and for you to find out what the problem is.
The Angular version is 20.3.15.
The app ...
3
votes
1
answer
91
views
Angular v21 SSR: validate user-agent in guard
I have an Angular v21 SSR app where I want a canMatch guard to choose mobile vs desktop routes based on the user-agent:
//app.routes.ts
export const routes: Routes = [
{ path: '', loadChildren: () =&...
Best practices
0
votes
2
replies
69
views
Angular v21 SSR provide dynamically loaded routes
I have Angular v21 app in ssr standalone architecture. In my app.ts I dynamically load either a mobile or desktop version depending on the window width. I want both mobile and desktop versions to ...
2
votes
1
answer
252
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
84
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
437
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
119
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
251
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
187
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
85
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 ...
1
vote
1
answer
121
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
98
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
3k
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
77
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
69
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)=&...