Questions tagged [angular-standalone-components]

58 questions
0
votes
0 answers

Angular standalone directive with "input" selector not applied globally

Angular 16.1.0 (Standalone architecture) I've created a standalone directive to be applied to all inputs: import { Directive, ElementRef } from '@angular/core'; @Directive({ standalone: true, selector: 'input', }) export class RedInput { …
0
votes
2 answers

Error: Can't bind to 'routerLink' since it isn't a known property of 'a'. with standalone component in Angular 15

I have a standalone component called home, but I am not able to have dynamic routerLinks in it even if I have imported RouterModule in my [imports] of my component. I do not have ngModules in my app to import it in app module. This simple dynamic…
poshy23
  • 23
  • 4
0
votes
0 answers

Angular Component Store doesn't update in Standalone Components

I have a simple Angular app with standalone components, where I am using NGRX Component Store. I am trying to set the state from ComponentA and subscribing to those changes in all the components. But, only the current component shows the changes,…
0
votes
2 answers

Conditionally load standalone bundles

I'm trying to refactor my dynamic module loading into a standalone strategy. In order to use the same route to programmatically load content Previously I built a module loader to logically load the correct module thus keeping the unused module out…
Ben Racicot
  • 5,332
  • 12
  • 66
  • 130
0
votes
0 answers

Angular standalone -ngrx effects dependency injection , how to configure it without any NullInjectorError: No provider for MatDialog

Not sure it is an error or config issue.. I have ngrx effect which has a dependency to MatDialog (whenever a success action happens in the effects, all the dialog should get closed ), When I inject in in the construction like constructor( private…
Jay
  • 336
  • 1
  • 4
  • 15
0
votes
0 answers

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 a component from this library into my…
0
votes
0 answers

Angular library of standalone components

I've been trying to create an Angular library of standalone components. I've generated a .tgz file using npm pack of the library, and I'm trying to use/import some of it's components into another Angular application. But when I do that, using the…
0
votes
1 answer

selector name doesn't match any elements for standalone component in Angular

I'm trying to use stadalone component but it gives me this error: The selector "app-login" did not match any elements But the thing is, is not written anywhere. My login component: import { Component, inject } from…
0
votes
0 answers

Unable to use GoogleMapsComponent in a Standalone Angular 16 app

Description I'm unable to use Google Maps Component with a Angular 16 app which doesn't use NgModules. I have imported GoogleMapModule in the imports array of my standalone component and yet the template cannot recognize the
0
votes
1 answer

Setting locale for Datepipe in Angular 16 standalone Components fails at build

When building locally it works fine. When building in the Gitlab Pipeline I encounter this error: ./src/app/app.component.ts:6:0-55 - Error: Module not found: Error: Can't resolve '@angular/common/locales/de-at' in…
0
votes
0 answers

Gesture Swipe in Angular 16 Application Using Hammer js not working

When i upgrade my app to Angular 16, hammerjs config not working with the config below main.ts @Injectable() export class MyHammerConfig extends HammerGestureConfig { overrides = { swipe: { direction: Hammer.DIRECTION_ALL }, }; } if…
0
votes
1 answer

Importing the BrowserModule into a standalone Angular16 project

Angular 16 is recently released and I have created a new standalone project without any module. then in a standalone component I need to import BrowserAnimationsModule from angular/platform-browser/animations. but when I import it, this error…
0
votes
1 answer

How to use PageTitleStrategy with provideRouter in a standalone main.ts file?

How can we provide our own page title strategy in a standalone main.ts, similar to how we provide a page title strategy using modules? @NgModule({ ... providers: [ ..., { provide: MyTitleStrategy, useClass: PageTitleStrategy } …
flyingpluto7
  • 1,079
  • 18
  • 20
0
votes
0 answers

Angular Module Federation: Importing the forRoot() modules when using loadRemoteModule with a standalone component

Angular module federation works for my multi-project angular app when using loadRemoteModule() on a standalone component. This standalone component is being used as a "widget" and therefore does not require routing. However, some module imports use…
0
votes
1 answer

How to use angular component when using barrels module (shared module)

I'd like to migrate my project to use standalone component. But I'm using quite a lot of "Barrel imports" What's a barrel? So, I just added the following to my component @Component({ standalone: true, // ... }) export class SharedComponent { …
Raphaël Balet
  • 6,334
  • 6
  • 41
  • 78