10,441 questions
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
...
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
40
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", ...
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
2
answers
551
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 │ ...
1
vote
1
answer
145
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 ...
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
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 ...
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 ...
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/...
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
727
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
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
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
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.
...
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
2
answers
101
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';
...
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
1
answer
454
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
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
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',
...
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 {...
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 &...
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
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 ...