229 questions
0
votes
0
answers
22
views
Angular19 error no provider when service provided in imported NgModule
I migrated my project from Angular15 to Angular19. I am running mixed mode for standalone components where only AppComponent is standalone whereas all other components are standalone:false.
I am using ...
2
votes
1
answer
114
views
Why doesn't the form display the datepicker?
I'm trying to display a form that consists of two fields: input and datepicker. However, the datepicker doesn't display. Instead, I see the following error message in the console:
ERROR RuntimeError: ...
0
votes
1
answer
83
views
Angular CLI generated component test files are still modular
I created a component using the Angular CLI (quite recent version)
ng --version
19.2.14
I did this using ng g c foo
The problem I have with this is that the FooComponent is standalone (it should be)...
0
votes
0
answers
71
views
How to give a lazy loaded Angular standalone component's providers to another component that is used in Ionics ModalController.create
I have been converting my Module based Ionic/Angular project to standalone.
I Have a lazy load component, that then displays another component using Ionics ModalController
const modal = await this....
0
votes
0
answers
166
views
Angular standalone reporting circular dependencies where there are none, and with no explanation as to why
I have been converting my Ionic Angular v20.1.4 application over to standalone, and I have had a few Circular dependency errors popup where there were none before.
A couple of others I found a work ...
1
vote
1
answer
84
views
How to use an Injection token for a ng/rx reducing in Angular standalone
I am migrating my Angular application, v20, which uses ng/rx store from module based to standalone.
I had chosen to use classes for most of my reducers. For example, I have a reducer as follows
@...
0
votes
1
answer
154
views
Angular standalone components library and NGRX slices
I'm migrating an application to standalone components using the following:
ng generate @angular/core:standalone
I've already migrated every component to standalone. I now need to remove unnecesary ...
3
votes
1
answer
79
views
Ionic Standalone Component - FormControlName
I have a form, reflected with some Ionic components:
<form [formGroup]="loginForm" (ngSubmit)="loginForm.valid && login(loginForm.controls['email'].value, loginForm.controls['...
3
votes
1
answer
267
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
2
answers
95
views
Display spinner component during bootstrapApplication provideAppInitializer
This question is similar to
Angular - How to show waiting indicator while app is loading using APP_INITIALIZER but for the new Angular standalone paradigm.
In my main.ts file, I can add some ...
0
votes
0
answers
17
views
How could mimic the module experience with Angular standalone components?
Since it looks like the modules in Angular are near the end of their life, and stand-alone components are the future, how can we provide dependencies in the same way as when a module is used?
With ...
3
votes
1
answer
526
views
Angular "No pipe found with name 'async'
I have the following Angular typescript and html template and it prompts the captioned error when build.
Typescript:
import { ChangeDetectionStrategy, Component, Inject, OnDestroy } from '@angular/...
0
votes
1
answer
422
views
Angular standalone component not rendering
I'm using Angular 19 and my version of node is 18.2. I've got an existing module project and have added a stand alone component. The issue I'm having is that the component does render and the ...
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>
&...
2
votes
1
answer
248
views
Cyclic dependency error in Angular 19 with standalone components
WebStorm gives me
Cyclic dependency between: AComponent -> BComponent -> CComponent -> AComponent
even though I use
forwardRef(() => AComponent),
In a child component.
Changing places ...
1
vote
1
answer
359
views
Implementing MapLibre GL in an Angular app
I am trying to follow this tutorial (https://maplibre.org/ngx-maplibre-gl/API/) to implement MapLibre GL in an Angular app, but can't make it.
I don't get how to implement this code from the tutorial:
...
0
votes
2
answers
150
views
How to resolve circular dependency in angular
I have components as follows
S1 (stand-alone)
N1 (Non standalone)
Base component
auth-Module
Now I am using S1 in Base component and N1 in S1 and getting the circular dependency. Can you please help ...
1
vote
1
answer
296
views
How to handle module imports specific to a library in an angular standalone app?
I have a library material-extension inside my angular workspace, in which I'm creating some components I require but Angular Material is lacking. In this extension I've installed the module ngx-editor,...
0
votes
1
answer
73
views
Angular standalone component dependency resolution
Dependency chain:
Parent1Component -> SomeTableComponent -> SlideToggleComponent -> MatSlideToggleModule
Parent2Component -> SomeTableComponent -> SlideToggleComponent -> ...
1
vote
1
answer
56
views
How can I deal with CommonModule references in a standalone directive?
I'm trying to migrate an old library of Angular components to standalone components.
A number of the components have a lot in common, so I use a superclass for all of the common behavior. At least as ...
1
vote
1
answer
703
views
Mocking injected provided service in standalone angular component AND NOT IN ROOT for karma jasmine tests
FYI: I am using angular 19.1.0 with karma
Let's assume we have this service and component
// NOT PROVIDED IN ROOT!
@Injectable()
export class TestService {
getData(): string {
return 'this is ...
2
votes
1
answer
336
views
Can't get through third and final step of Angular standalone migration: Providers from the BrowserModule have already been loaded
I've recently successfully migrated an application of mine to Angular 19 and PrimeNG 19. All I had set aside for doing later was migrating to the new, preferred use of standalone components.
The first ...
0
votes
0
answers
390
views
Problem with provideAppInitializer and InjectionToken hierarchy/sequence in Angular 19
My problem is as follows:
I use the package api-client-generator (https://www.npmjs.com/package/api-client-generator) which uses two InjectionTokens to build API requests. These tokens include the API ...
5
votes
1
answer
4k
views
Angular 19 routing child components in standalone architecture
How to define child routes of lazy loaded standalone component? In app.routes.ts I defined:
export const routes: Routes = [
{
path: 'some/parent',
loadComponent: () => import('./my-...
2
votes
1
answer
718
views
ngx-bootstrap doesn't support moduleless approach
I just tried installing ngx-bootstrap into an Angular 19 project which has standalone components by default:
E:\Code\angular-app>ng add ngx-bootstrap
✔ Determining Package Manager
› Using package ...
1
vote
1
answer
81
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 ...
2
votes
1
answer
236
views
How to use root store in a standalone Component?
I'm working on a project using the old NgModules architecture and I'm transitioning into the new standalone components gradually. I'm stuck right now on how to provide the root store to the standalone ...
1
vote
1
answer
954
views
Importing standalone component in TestBed not working
I'm upgrading my app from Angular 17 to Angular 19 (19.0.6) and nx20. I encountered some problems with TestBed and standalone component.
I have the following code :
@Component({
templateUrl: './...
2
votes
2
answers
270
views
Unused Injectable services with providedIn: 'root' are Included in main.js, increasing bundle size (Angular 19, Standalone)
Issue:
In an Angular 19 standalone application, I have an API client file containing over 100 @Injectable services, each marked with providedIn: 'root'. However, only 3–4 of these services are used in ...
3
votes
2
answers
6k
views
Migrating from angular 5 to angular 19 in NgModule based app
I am migrating old angular project from version 5 to version 19. I have indentified all compatible and dependent libraries and able to migrate code. However I keep getting standanlone error.
Note : I ...
5
votes
2
answers
6k
views
Angular 19 Standalone Component Error: "No provider for _HttpClient" Despite HttpClientModule Imported
I am working on an Angular standalone application and encountering the following error when using HttpClient in my DataService:
ERROR Error [NullInjectorError]: R3InjectorError(Standalone[...
1
vote
0
answers
63
views
Ionic Standalone increase in initial bundle size. Lazy loaded components included in initial Bundle
I'm currently working on a migration from IonicModule with Webpack to Ionic Standalone Components with ESBuild.
I expected the initial bundle size to shrink, since some components are only required in ...
1
vote
0
answers
124
views
Issues HttpClientInMemoryWebApiModule in Angular Standalone
I'm trying to use HttpClientInMemoryWebApiModule in an Angular V 18.2.11 standalone application and I'm encountering this error:
ERROR Error [NullInjectorError]: R3InjectorError(Standalone[...
1
vote
1
answer
423
views
Error NG0800: Importing providers supports NgModule or ModuleWithProviders but got a standalone component after migrating to standalone components
I’ve been migrating my Angular app to use standalone components following the official migration guide. I ran the following commands:
ng g @angular/core:standalone and selected "Convert all ...
0
votes
0
answers
28
views
How to make an Ionic component persist between components
I am using Ionic to build a program that has a few components. On start-up, the program opens a login component, and then when the user is logged in, it redirects to my home component.
I have a '...
1
vote
2
answers
80
views
Why does Leaflet create multiple pages [duplicate]
import { Component } from '@angular/core';
import L from 'leaflet';
import { isPlatformBrowser } from '@angular/common';
@Component({
selector: 'app-map',
standalone: true,
imports: ...
15
votes
4
answers
26k
views
Angular 19 - Component AppComponent is standalone, and cannot be declared in an NgModule
On my Angular v19 app I get the following error:
Component AppComponent is standalone, and cannot be declared in an NgModule
or
'imports' is only valid on a component that is standalone.
It worked ...
2
votes
2
answers
1k
views
How to mock a service inside a Cypress Component Test for a Angular Standalone Component
How to provide a mock for a Standalone component in a cypress component test?
I have this mount-function inside my test:
function mount() {
cy.mount(TestComponent, {
providers: [
...
1
vote
2
answers
465
views
What is the main benefit from NgModule in Angular 17
Now with Angular 17 I understand that you don't need to use the NgModule to run the different components in the application, because you can import them in the app.component.ts. With this approach; ...
1
vote
1
answer
86
views
one component with multiple HTML support
I'm trying to breakdown bigger HTML chunks which has repeated markup based on flags.
Is there a way we can make html code split into files one.html, two.html and render them into my component (.ts ...
1
vote
1
answer
827
views
Angular standalone with ngx-translate Globally
I do have a quick question—wouldn't it be nice if we didn't have to import the TranslateModule every time? I was wondering if there are any other ways to make it global with the new Angular standalone ...
2
votes
1
answer
1k
views
provideHttpClient "Type 'EnvironmentProviders' is not assignable to type 'Provider'. Error in Angular 18
I am working on an Angular 18 application and was getting errors from the deprecated HttpClientModule so I moved to provideHttpClient and keep getting the following error:
Type 'EnvironmentProviders' ...
1
vote
1
answer
3k
views
How to create app.module.ts in an existing Angular 18 project?
I’m using Angular 18.2.8 and I’ve already created a project and worked on it. However, I noticed that the project does not include an app.module.ts file. After searching, I found that starting from ...
2
votes
2
answers
2k
views
How to configure ngx-logger in standalone components (Angular 18)
I have an Angular 18 application now built on standalone component concepts. I want to use ngx-logger for logging errors, warnings and Inf to server. I have seen multiple articles about ng-logger in ...
1
vote
2
answers
736
views
No compile error for missing import in standalone Angular component
I'm working with standalone Angular 18 components and ran into an issue.
I have a custom component (FooComponent) that I forgot to import into another standalone component. However, no compile-time ...
0
votes
1
answer
409
views
How to use Spline Viewer in Angular 18 project
I can use Spline in my Angular project using Code Export, but non-step Scroll supposedly only works with the viewer.
import { SplineViewer } from '@splinetool/viewer';
and
imports: [SplineViewer],
...
1
vote
1
answer
1k
views
Translate Pipe not correctly importing while using ngx-translate in Angular 18
I'm trying to use the ngx-translate library in Angular 18, but it gives me the following error message in the app.component.ts file when I try to use Translate pipe.
I am trying to ultimately display ...
1
vote
1
answer
586
views
Overriding dependency directive after migrating to angular standalone components
I began migrating my angular 18 application to standalone components and I've run into issues overriding various imports. I'm using Angular 18, Material, NGMocks, Spectator (as testbed replacement) ...
1
vote
2
answers
843
views
Angular 17: Standalone components and not a root service
How can I provide a service that is not at the root of the application, and use the same instance between several components and other services? Not using providers in routes and not using ng module.
...
0
votes
1
answer
86
views
Can standalone components handle nested ngModules?
How to correctly handle below scenario ?
StandaloneComponent ( needs for example ReactiveFormsModule )
ModuleA
ModuleB ( imports ReactiveFormsModule)
If I got above structure reactive forms module is ...