203
questions
24
votes
4
answers
22k
views
Unexpected synthetic property @transitionMessages found with standalone compoent angular 15
I am migrating the angular application to the standalone component. Removed the ngModule and app.module.ts file
main.ts
bootstrapApplication(AppComponent,{
providers:[importProvidersFrom(...
22
votes
6
answers
20k
views
NullInjectorError - Root standalone component does not import HttpClientModule properly
I have an issue, I want to rewrite my app code and change main module to main root standalone component pointed in main.ts.
All works fine but I have an issue with HttpClientModule. I am using ...
22
votes
1
answer
11k
views
How to import a NgModule library with forRoot() to an Angular standalone component?
I'm currently working on an Angular application (version 16.1.3) which utilizes standalone components. This application also relies on an Angular library that uses NgModules. I'm attempting to import ...
16
votes
3
answers
12k
views
How to use Ngxs in a standalone component?
Is it possible to use Ngxs in a standalone component? I've tried importing the NgxsModule in the following ways:
@Component({
...
imports: [
...
NgxsModule.forFeature([MyState]),
...
and
...
15
votes
3
answers
16k
views
Use @ngx-translate in standalone components in Angular 17
I use standalone components in Angular 17. When I used module architecture, I didn't have this problem. I added it to import in AppModule and it works good.
imports: [
TranslateModule.forRoot(loader)
...
13
votes
4
answers
27k
views
How to use Standalone Components, Pipes, or Directives in feature modules
I updated my angular project to angular 14. Now I want to have some standalone components, pipes, or directives.
I have a featured module named ProductModule and want to use a standalone pipe called ...
12
votes
1
answer
1k
views
Anyone try using InMemoryWebAPI with standalone components?
I am using Angular v16 with standalone components. I implemented InMemoryWebAPI as I have in NgModule-based projects, but it doesn't seem to be working. I keep getting 404 not found.
Anyone try this ...
9
votes
4
answers
9k
views
How to register nested routes on an Angular standalone component?
I need to migrate the component/view below (with nested routes) from NgModule to standalone
Angular docs for routing do not mention standalone, and standalone docs only show how to route to a ...
8
votes
1
answer
2k
views
How can I import a module into standalone directive
The imports attribute is available on the @Component decorator but not on the @Directive decorator.
Is there another way to import a module into a standalone directive ?
8
votes
0
answers
3k
views
Angular 16 : ERROR TypeError: Cannot read properties of undefined (reading 'ɵcmp')
Hello I have a problem with the standalone components since I switched to the default builder working but impossible to access the site so I use the new builder in esbuild test and with it it finally ...
7
votes
3
answers
9k
views
TypeError: Cannot read properties of undefined (reading 'ɵcmp') Angular
I have created a custom ui library using only standalone components and here's my public-api.ts file.
/*
* Public API Surface of ih-ui-lib
*/
export * from './lib/ui-lib.service';
export * from './...
7
votes
4
answers
10k
views
Angular 16 Standalone component, "Can't bind to 'formGroup' since it isn't a known property of 'form'"
This is not the usual module-related issue. Because I'm using Angular v16, standalone component, no module is required.
TS
import { FormBuilder, FormGroup, FormControl, Validators, FormsModule } from '...
6
votes
1
answer
6k
views
Angular 15 Ref Error: Cannot access 'Component A' before initialization
I am facing one issue while importing standalone component within each other.
Component A.
@Component({
standalone: true,
selector: 'app-a',
templateUrl: './a.component.html',
styleUrls: ['./a....
6
votes
2
answers
3k
views
Mock standalone directive in a standalone component
I'm trying to write a unit test for a standalone component and mock its dependency. This standalone component has the following content:
import { Component, OnInit } from '@angular/core';
import { ...
6
votes
1
answer
3k
views
Angular: When to use signal() vs model()?
When should we use signal() vs model() in Angular?
Angular says the following:
ModelSignal is a WritableSignal which means that its value can be changed from anywhere using the set and update methods....