Questions tagged [angular2-modules]

132 questions
4
votes
1 answer

"Module" is not part of any NgModule or the module has not been imported into your module

I have an application with some modules. Here is my root module: // imports... @NgModule({ bootstrap: [ AppModule ], declarations: [ AppComponent, ...APP_PIPES // Array with my pipes ], imports: [ // import Angular's…
dev_054
  • 3,448
  • 8
  • 29
  • 56
4
votes
1 answer

Angular2, Include module of components rather than all components separately

I would like to bundle multiple components into a module (Widget1Module), and then inject that module into another module (AdminModule), giving all components in AdminModule access to the components in the Widget1Module. I want to do this is to…
Gerard Simpson
  • 2,026
  • 2
  • 30
  • 45
4
votes
1 answer

Angular 2 Application Structure: Circular Module Dependencies

On the Angular 2 Style Guide, there is a recommendation for a directory structure: https://angular.io/docs/ts/latest/guide/style-guide.html#04-06 I generally think it's a good recommendation, I'd intend on doing something very similar myself. …
Daniel Patrick
  • 3,980
  • 6
  • 29
  • 49
4
votes
2 answers

how to use sharedModule in angular2?

I have one angular2 component which I want to share among multiple modules. So I wrote below sharedModule , import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import {GenericComponent} from…
Bhushan Gadekar
  • 13,485
  • 21
  • 82
  • 131
3
votes
1 answer

Angular 8, How pass configurations to a lazy loaded Module

I need to pass providers to a Lazy loaded module. Context: I have a module that access an API and returns some configs to be rendered in the components. This is the Module: @NgModule({ declarations: [AuxTablesComponent,…
3
votes
0 answers

Angular4 - use components service in guard

I have a lazy-loaded-module with a root and child componets. I also have a service to share data between the root and the child components and siblings. The use case behind is a wizard, where the user can set some data in multiple steps. The data of…
user3507003
  • 359
  • 4
  • 17
3
votes
1 answer

How to bootstrap two Modules using bootstrapModule() in Angular2?

Normally this is how a Module is integrated or bootstrapped with the main.ts. import {platformBrowserDynamic} from'@angular/platform-browser-dynamic' import {AppModule} from './app.module' platformBrowserDynamic().bootstrapModule(AppModule) But…
sigdelsanjog
  • 528
  • 1
  • 11
  • 30
3
votes
0 answers

Cannot debug method in Class in Angular Lazy-Loaded Module

Recently, I try to debug the methods in my class. I tried several way: using Webstorm Debugging, Augury, Browser Debugging Tool but the results are the same. I started by put a breakpoint at the begin of the method. Then I refresh the browser and…
TheRemjx
  • 105
  • 1
  • 6
3
votes
1 answer

npm run start working whereas ng serve not working

I try to run angular 2 app with ng serve in Linux machine. It is not working. But I tried npm run start command. It is working fine. I got the following message when I tried ng serve command. As a forewarning, we are moving the CLI npm package to…
nilashan
  • 690
  • 1
  • 8
  • 30
3
votes
2 answers

Routing & Modules

I have the following routing configuration in my app: app.module.ts @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, HttpModule, AppRouting, // Feature Modules CoreModule, AuthModule, …
3
votes
1 answer

Angular 2 ERROR in Cannot determine the module for class ManagersService i

When trying to build using ng build -prod I am getting the following error ERROR in Cannot determine the module for class ManagersService in C:/Test/src/app/shared/common/managers/managers.service.ts! Add ManagersService to the NgModule to fix…
pantonis
  • 5,601
  • 12
  • 58
  • 115
3
votes
1 answer

Angular 2 architecture - place for shared services accross modules

I have read about some Angular 2 project architecture, but they are not my case. My question is where to place shared service that is used across modules. My project has multiple modules, for example: admin module and user module. This this the…
3
votes
0 answers

Angular 2 Webpack Modules Issue - Build fails because of a base class

I'm having an issue loading an Angular 2 application after I've moved a few components from one module to another. My guess is that I'm doing something wrong in the code itself however the error I'm getting is not helpful and I don't know if it's an…
Daniel Grima
  • 2,765
  • 7
  • 34
  • 58
3
votes
2 answers

When create angular2 module

I want to write news website where user will be accessed only after login. I can write everything in app.module but want to have nice architecture and I need an advice. Should I create another module for account? Should I create another module for…
gsiradze
  • 4,583
  • 15
  • 64
  • 111
3
votes
2 answers

Angular 2 global component

My structure is as follows : App *component, module, template* Component 1 *component, module, template* Component 11 *component, module, template* Global Component *component, temaplte, BUT NO…
user4676340
1 2 3
8 9