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
1
vote
2 answers

LazyLoad Module in Angular

I am following this blog for Lazy Lodaing a Module Everything is fine except the part when it asks me to assign static path for the module to be loaded. the name of the module will depend on the users choice as i may have a number of modules how can…
Ankit Raonka
  • 6,429
  • 10
  • 35
  • 54
1
vote
1 answer

How to do routing on nested modules in Angular?

I got a Module hierarchy like this: app -- module1 - submodule1 - submodule2 I want to know how to do the routing from submodules to modules, and from modules to the main app module. So far I can route from modules to main app module like…
Jonathan Solorzano
  • 6,812
  • 20
  • 70
  • 131
1
vote
1 answer

Angular resolve with separate modules

How can I activate a RouteGuard or Resolve on child routes within another module? Example Scenario: I have an application which has many separate modules, each defining their own routes. Consider these modules definining the following…
David
  • 15,652
  • 26
  • 115
  • 156
1
vote
0 answers

ng2-eonasdan-datetimepicker ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator'

I have been trying to use the ng2-eonasdan-datetimepicker but not with much luck. Here's what's happening: Z:\Dashboard>npm start > dashboard@0.0.0 start Z:\Dashboard > ng serve ** NG Live Development Server is running on http://localhost:4200…
Jus10
  • 14,519
  • 21
  • 52
  • 77
1
vote
1 answer

Render components without explicit dependency in ngModule

I have a library called foo that contains an angular component called FooContentComponent that renders various types of content: {{item.text}}
1
vote
2 answers

Error: Template parse errors: 'selector' is not a known element. How to Import Component form another module

How to import component from another module? Project Structure: | |-users.module.ts // (i.e. exports: [AddressComponent]) |--profile.component.ts |--address.component.ts | |-customer.module.ts |--basket.component.ts | |-app.component.ts Address…
Malik Shahzad
  • 6,703
  • 3
  • 37
  • 49
1
vote
3 answers

Angular 2 multiple components declaration

I'm working on a generic Ionic 2 app which consist in loading and displaying multiple components on the first page. Each add-ons need to be easily created and implemented in the app very easily. So I created a file named "addon-declaration.ts".…
iStornZ
  • 603
  • 1
  • 8
  • 19
1
vote
1 answer

Uncaught (in promise): Error: No NgModule metadata found for '[object Object]'

src/+login/index.ts import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { RouterModule } from…
linyimeng
  • 21
  • 1
  • 3
1
vote
2 answers

Extending Ionic2 and injecting ModalController

I am trying to develop a datepicker component that can be used for any project. I have an NgModule that has components and I inject IonicModule in to it so it can use all the components/directives of ionic2. @NgModule({ imports: [ …
misha130
  • 5,457
  • 2
  • 29
  • 51
1
vote
0 answers

Error with Ionic2 RC0 loading external modules

In Ionic 2 RC0, I have a problem with angular2-text-mask "1.0.1", I think this is a problem with AoT and most of the external modules though. In dev mode, I got this error: bundle dev failed: Module…
1
vote
2 answers

Angular2 2.0.0 How to add simple functions to @NgModule

I would like to create a "Utility Module": tnt.module.ts: import {NgModule} from '@angular/core'; import {toUpperCase} from "./tnt.utils"; @NgModule({ declarations: [ toUpperCase ], exports: [ toUpperCase ] }) export default class…
Brett
  • 1,717
  • 1
  • 26
  • 38
0
votes
1 answer

How to remove @NgModule, app.module.ts files after upgrading to Angular 14+

Before Angular 14, It was mandatory to add modules to organize applicaiton with component hierarcy. After upgradation, we can optimize our code by removing modules and add dependancies to component level. What steps we need to consider while…
0
votes
0 answers

Please define one of these @NgModule.bootstrap

"main.ts:12 Error: NG0403: The module AppModule was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these. at PlatformRef._moduleDoBootstrap " bootstrap: [ ]
0
votes
0 answers

'XModule' does not appear to be an NgModule class

Most modules in my project in module.ts file say they don't belong to NgModule class. for example; I am getting an error like "'RouterModule' does not appear to be an NgModule class" of RouterModule. This error is giving in all modules. In the error…
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…