10,441 questions
1
vote
2
answers
109
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
...
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: ...
0
votes
0
answers
25
views
Cordova UI Router not reloading when using web inspector manual refresh to reload app
When using web inspector on chrome/android or safari/iphone my app will launch just fine and I can inspect everything. However on certain occasions, especially on Safari, app startup console messages ...
0
votes
0
answers
64
views
Can you use an angular standalone component to import a module that contains your whole app
I am trying to make a project manager in angular and host it with cloudflare. I can't get my login page to come up. The console gives me this
main-NTC3P324.js:7 ERROR TypeError: Cannot read properties ...
0
votes
0
answers
39
views
Root component ActivatedRoute route tree disconnected from child routes?
We have a module-based A19 application which has a root component/module and a relatively deep tree of child routes/modules.
app-routing.module.ts:
const routes: Routes = [
{ path: "foo", ...
1
vote
0
answers
17
views
using Angularjs 1.8.3, my menu item showSubmissions shows the login screen instead of the submissions page
When I click on the $ctrl.showSubmissions() it shows the login screen instead of the submissions page.
I have console.logs and it appears the auth is OK, it does not seem to be routing correctly.
All ...
2
votes
2
answers
137
views
Angular JS Angular 18 hybrid routing
I have an angular js/angular 18 hybrid application which is working, but what I am trying to do is migrate the routes of the customer users like this:
.state('customer', {
url: "/...
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
2
answers
550
views
Component TasksComponent is standalone, and cannot be declared in an NgModule
X [ERROR] TS-996008: Component TasksComponent is standalone, and cannot be declared in an NgModule. Did you mean to import it instead? [plugin angular-compiler]
src/app/app.module.ts:13:4:
13 │ ...
0
votes
0
answers
36
views
AngularJS UI-Router dynamic resolve list
We currently have this dynamic routing (don't mind sytax errors, transformed from CoffeeScript by hand):
angular
.module 'App'
.config(function ($stateProvider) {
$stateProvider
...
1
vote
1
answer
144
views
Angular: How to block RouteReuseStrategy based on condition?
I'm trying to block the RouteReuseStrategy based on some conditions but this is not happening. I've a route name as comp-a which is called in two different ways. 1 time is from a back button and the ...
0
votes
3
answers
386
views
Spring Boot integration with angular
Is there a way to run my backend Spring Boot project along with the Angular frontend, without starting a separate Angular server? Can I deploy the entire application on the backend server only?
1
vote
1
answer
37
views
How to mock AngularJS module config providers
In our module we have a custom method defined that essentially adds on more functionality to $stateProvider...
(function () {
'use strict';
angular
.module('someModule', []...
1
vote
1
answer
46
views
Loading a page throws "NG8001: 'router-outlet' is not a known element"
I am having a problem: at first I was trying to log in to connect with main, but while I moved, the following error appeared, which I could not solve in any way.
NG8001: 'router-outlet' is not a known ...
-1
votes
2
answers
74
views
Error : NG8001: 'router-outlet' is not a known element: in Angular
I am getting below error:
NG8001: router-outlet is not a known element:
If router-outlet is an Angular component, then verify that it is part of this module.
If router-outlet is a Web Component then ...
2
votes
1
answer
5k
views
Angular 18 Routing/URL
I am currently exploring angular 18 and noticed that sometimes when the app is routed to a component and not on the homepage;
If I refresh, it takes me back to the home page instead of reloading the ...
0
votes
1
answer
116
views
Angular PrimeNG TabMenu reload on same item
I want to know how to manually reload an active menu item of PrimeNG.
I know that there are ways to reload the current component manually but i want to know if there's any method implemented by ...
-2
votes
1
answer
183
views
Issue with Route Redirection on Angular 18 App Hosted on Azure
I am experiencing an issue with my Angular 18 application hosted on Azure. When accessing the application at the URL yyy.net (free plan), it correctly redirects to yyy.net/home. However, when I ...
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 ...
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 ...
1
vote
1
answer
86
views
Unable to get values from Service in Angular
I have created and application with Login Functionality and want to get the logged In user name in the components
Service File:
login({ username, password }: any): Observable<any> {
if (...
1
vote
1
answer
724
views
How to Simulate "Empty Cache and Hard Reload" Feature in Browser Using Angular 17 Code?
I am working on an Angular 17 project and need to simulate the "Empty Cache and Hard Reload" feature that browsers offer. Essentially, I want to force a full refresh of the application, ...
0
votes
0
answers
28
views
Navigating directly to Angular routes with path parameters
Is it possible navigate directly to Angular routes with path parameters through the browser?
I want to access my chart component directly from the browser using link like this "http://localhost:...
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 ...
1
vote
3
answers
505
views
Angular 17 child routes not works
I have a very simple angular 17 application, and i got problems with routing to child routes. All components are standalone.
this is how my app.routes.ts looks like:
export const routes: Routes = [
{...
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/...
0
votes
1
answer
47
views
Angular navigation item: on first click navigate to page AND open dropdown?
I have Angular navigation item component:
<div(click)="handleToggleDropdown()">
<a[routerLink]="route">{{ text }}</a>
</div>
import { Component, Input } ...
0
votes
2
answers
145
views
Angular textarea does not update data on time but the console shows it correctly
I use the service socket.io to emit and receive data. When the send button is clicked, it emits data and shows FENEmitInfo, then receives the data and shows FENSocketioGetCnt and FENSocketioFilterCnt.
...
0
votes
0
answers
36
views
Any difference between storing data in an ReplaySubject or passing it back to resolver to store?
In Angular 18, I see you pass the data back to the resolver and the page can load the data. However, on 'MOST' all calls, something like this is going on storing the data into something like a ...
1
vote
2
answers
113
views
Angular & Bootstrap - Routes
I have created a menu, breadcrumbs, with components and their children. The problem is that I see the first child perfectly with but when I open a child of that child (grandchildren so to speak) the ...
1
vote
0
answers
39
views
Submenu Not Working After Lazy Loading Dashboard in Angular
I'm working on an Angular application with lazy loading for the dashboard screen. I've encountered an issue where the submenu is not functioning properly when the dashboard is loaded lazily. Below is ...
1
vote
2
answers
100
views
Relative path of Parent Component is added to asset path when page is reloaded
So I have Ng routing for Angular18 configured as below for app.routes.ts which is default routing
import { Routes } from '@angular/router';
import { LoginComponent } from './login/login.component';
...
0
votes
1
answer
50
views
Angular Always redirecting to default path:
const routes: Routes = [
{ path: "admin_login", component: AdminLoginComponent },
{ path: "login", component: LoginComponent },
{ path: "owner", component: ...
1
vote
1
answer
68
views
Unable to get queryParams in a module component (Angular)
Kind of new to Angular (17)
This is my app structure
--app.routing.modules.ts
--app.component.ts
------module1.routing.module
-------------module2.routing.module
-------------module2.component.ts
-----...
0
votes
0
answers
47
views
Cannot fix HttpClient Error in Angular Project
I am trying to set up a runtime configuration value for a URL in my angular project how it is outlined in this thread, and I can't seem to figure out why i am getting a NullInjectorError: ...
0
votes
1
answer
452
views
Error NG0303 Can't bind to '*ngIf' since it isn't a known property of 'nav' - Angular 18
I am creating a project in Angular 18. For now, I am only working on the frontend, but I need to create a "test" login. The problem I have is that the navbar was showing in my "login&...
1
vote
1
answer
193
views
Access child components through <router-outlet> tag in Angular 17
In my app.routes.ts,
export const routes: Routes = [
...
{
path: "student",
component: StudentComponent,
children: [
{
path: "first-component",
...
1
vote
1
answer
47
views
How to get value before calling .forRoot?
export function getApiKey(config: WebConfigService): Promise<boolean> {
return new Promise((resolve, reject) => {
config.getConfigLoaded().subscribe(key => {
if (key) {
...
1
vote
1
answer
469
views
Web Routing in Angular 17
I have a routing file written as below:
{
path: "student",
component: StudentComponent,
canActivate: [authenticationGuard],
data: {
role: "student",
...
1
vote
1
answer
39
views
Angular Loading time on menu click
When I click on the menu item it takes too much time to load
This is my app-routing-modules.ts
const routes: Routes = [
{
path: '',
children: [
{
path: 'login',
...
0
votes
1
answer
40
views
NG8001: 'app-servers' is not a known element
Error
Code
I have tried everything but failed to resolve
I am using same selector but not resolved
It should display label, input box and button.
I have tried the solutions given but not resolved my ...
2
votes
1
answer
87
views
Im using the latest AuthGuard method, its supposed to redirect using router.createUrlTree if user is not logged in but it fails to do so
Im unable to redirect to /user pleas help
here is the AuthGuard where I have subscribed to an authService.authSubStatus that emits a boolean
import { inject, Injectable } from '@angular/core';
import {...
-1
votes
1
answer
23
views
Angular changes URL, but doesn't open child
I'm getting strange behaviour.
My parent URL has this.
ProjectsComponent HTML snippet
<a [routerLink]="[contract._id]">{{ contract.name }}</a>
Scenario 1
When I navigate to the ...
0
votes
3
answers
592
views
When I navigate to the URL'http://localhost:4200/', it redirects me back
login.components.ts:
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {AuthService} from &...
1
vote
2
answers
302
views
Angular ngOnInit doesnt get triggered when i refresh the page
I have a problem where ngOnInit doesnt get triggered when i refresh the page or when i try to directly access my url knowing i havent implemented any kind of protection or any kind of guards.
meaning ...
0
votes
0
answers
42
views
Nested routes with param and router refresh process
I have the following routes definition:
{
path: 'clients',
loadChildren: () =>
import('@app/domains/clients').then((m) => m.WebClientsModule,),
},
Then inside the WebClientsModule,...
1
vote
1
answer
353
views
Bundle size after migrating to all standalone and implementing lazy loading
Initially I had implemented a single module per component, and module-based lazy-loading in my app. At that time my main.js bundle size was 2mb. Now I converted to all standalone components and ...
1
vote
0
answers
76
views
Named Router Outlet- I need to active the both multiple outlets Using angularv17.0^.0^(main outlet + 2 named Outlets)
Problem : - The second named router outlet(chat Area) in the router module is not rendering but the URL works fine.
The UI idea is inspired from the vscode.
which is : - the icons from the left side ...
3
votes
1
answer
350
views
Implement routing with steps component in a dynamic dialog priemng
Could anyone help me with implementing a steps component in a dynamic dialog in primeng. I am working on a sample project where I need to implement login screen in a dialog box that includes multiple ...