Questions tagged [ng-modules]

Angular NgModule is a class marked by the @NgModule decorator.

NgModules configure the injector and the compiler and help organize related things together.

An NgModule is a class marked by the @NgModule decorator. @NgModule takes a metadata object that describes how to compile a component's template and how to create an injector at runtime. It identifies the module's own components, directives, and pipes, making some of them public, through the exports property, so that external components can use them. @NgModule can also add service providers to the application dependency injectors.

Resources

218 questions
0
votes
0 answers

I am getting the fllowing error when I am running the npm run dev command. Compiling the app seems to be fine. there is only issue with building

Error: src/app/shared/pages/scan-qr/scan-qr.module.ts:16:5 - error NG6002: 'SharedComponentsModule' does not appear to be a NgModule class. SharedComponentsModule, …
Amit Sharma
  • 1,775
  • 3
  • 11
  • 20
0
votes
1 answer

Can't bind to 'ngModel' since it isn't a known property of 'mat-slide-toggle', Angular material not working fully

I am experiencing the following error: Can't bind to '{ngModel}' since it isn't a known property of 'mat-slide-toggle'. I've found similar threads on this topic that were resolved by importing the forms module, or reactive forms module. However I am…
mike dorn
  • 3
  • 2
0
votes
2 answers

Angular Routing: correct way of redirecting to 404 page for nested routes

In my Angular application every feature has their own feature-routing.module.ts, and then feature.module.tsis imported to app.module.ts. It is actually directing to not-found page, but it is not redirecting to /select-fund when path is…
Saidamir
  • 134
  • 2
  • 12
0
votes
0 answers

Module build failed after migration to PNPM

I've just migrated my project from NPM to PNPM following this tutorial: https://dev.to/andreychernykh/yarn-npm-to-pnpm-migration-guide-2n04 I had no issues at all, but as soon as I run ng serve command, at the end I got this errors: ./src/main.ts -…
Asder999
  • 87
  • 1
  • 7
0
votes
1 answer

Angular14 configurations.production.fileReplacements with module.ts problem

I need to have different module for dev mode and prod mode so I think to use the angular.json option of fileReplacements creating a test.module.ts and test.module.prod.ts. Then I add the following to the angular.json configuration: { "replace":…
Edo2610
  • 184
  • 1
  • 9
0
votes
0 answers

Angular InjectionToken in NgModule import array?

I need to use the environment.production flag in an import array of a NgModule: @NgModule({ import: [ ... !environment.production ? StoreDevtoolsModule.instrument() : [], ] } But we've multiple possible environment files at this time,…
Marc Rambow
  • 86
  • 1
  • 8
0
votes
0 answers

Conditionally Import Shared module using static method forRoot

I have angular application divided into various modules on the basis of user type. Like AdminModule, CustomerModule, VendorMoudle etc. For each modules I've a separate respective shared module, having all the reusable items (components, pipes,…
Khurram Ilyas
  • 117
  • 3
  • 19
0
votes
0 answers

No component factory found error (only in production)

I have a SAP app built with Angular and .net. When I'm trying to open a dialog I get the following error: ERROR Error: No component factory found for vn. Did you add it to @NgModule.entryComponents? However, I have no component called vn. This…
alice
  • 59
  • 1
  • 2
  • 7
0
votes
0 answers

Imported custom module inside other custom module does not recognize the exported components

Even though I import and export the correct modules and components, the Angular compiler throws an error when I try to use a custom component from a custom module, inside a custom component inside a different module. button.module.ts: import {…
PiwiTheKiwi
  • 129
  • 1
  • 14
0
votes
0 answers

Uncaught TypeError: Cannot read properties of undefined (reading 'id') at registerNgModuleType Issue

MEAN Stack Project where the front (built with Angular) runs on localhost:4000 The Problem is sometimes the App Crashes displaying a white blank page with the following error in console: The issue resolves when I remove node modules folder and…
0
votes
2 answers

How to include an Alert Component into two different modules in Angular?

I have to use the alert component into different modules A and B in Angular. Even if the implementation is the same for both modules, the tag is recognized as such only in module A. Module B returns in the webbrowser the error: Uncaught Error:…
a a
  • 49
  • 1
  • 6
0
votes
1 answer

Appears in the NgModule.imports of ViewClientModule, but itself has errors 664 export class SharedModule { }

I have recently updated the angular project version from 11 to 13, after up-gradation its giving one error "error NG6002: Appears in the NgModule.imports of VerifiedprofilesharedModule, but itself has errors 664 export class SharedModule { }" enter…
0
votes
1 answer

How can I use Angular/Materials without using NgModule and only Using 'Component' from /core?

I have a functional application built with the Angular CLI v-13.2.6 and I just want to add the great features of angular material forms and icons. I am already using the Component decorator in my class therefore I get an error when trying to use…
0
votes
1 answer

Angular NgModel not assigning select value to object parameter

Im trying to assing the value of a select option to the name of an object in Angular. The list of names is showing correctly, but upon submitting the form the value is empty. I did import the FormsModule in app.module.ts like other posts on here…
0
votes
0 answers

Is there any downsides to preloading feature modules in Angular?

I just learned about preloading feature modules in Angular via adding this line inside the RootModules.forChild() method inside imports in your root module.ts file: preloadingStrategy: PreloadAllModules It seems to speed up my application! I am…