Questions tagged [angular2-modules]

132 questions
6
votes
0 answers

Type XYZComponent is a part of two modules, module gets confused what route to take

Here is the scenario. I have a UserConsoleModule and ShoppingCartModule. I have a component called MyProfileComponent. When you go to /user-console, you are shown MyProfileComponent and hence I have put that in the declarations of UserConsoleModule.…
6
votes
3 answers

Multiple modules in Angular 2

I have an Angular 2 app (RC7) which started as a single component but is quickly becoming used throughout the project in various different (and sometimes completely unrelated) ways. As a result of this, a single NgModule bootstrapping all the…
RyanGled
  • 356
  • 3
  • 9
5
votes
2 answers

Would the module loaded twice in Lazy-load module

When I recently read the Angular2's doc, it says like this: What if I import the same module twice? That's not a problem. When three modules all import Module 'A', Angular evaluates Module 'A' once, the first time it encounters it, and doesn't do…
IcyBrk
  • 872
  • 8
  • 18
5
votes
1 answer

How to import/use lazy load module on another ng-module

I have two ng-module Dash Board Repeat order list I had loaded Repeat order through the lazy load. Now I want to use Repeat order, inside dashboard as html If I am doing same it is throwing me an…
Bharat Joshi
  • 179
  • 1
  • 3
  • 14
5
votes
3 answers

Angular2 "No provider for Service!" error when provider is added @NgModule

I have an app module and single component application (made to demonstrate my problem), and getting following error: Error in ./AppComponent class AppComponent_Host - inline template:0:0 caused by: No provider for UserService! ; Zone: ;…
Fazal Wahid
  • 175
  • 2
  • 15
5
votes
2 answers

Angular 2 Routing Error with ModuleWithProviders

I'm new in Angular 2 I need help on the routing part. I'm using http://jasonwatmore.com/post/2016/09/29/angular-2-user-registration-and-login-example-tutorial I got an error Exported variable 'routing' has or is using name 'ModuleWithProviders'…
Frank Mendez
  • 466
  • 1
  • 10
  • 22
4
votes
1 answer

What is Angular's Custom Module lifecycle?

Is there information about a Module's lifecycle. Currently the lifecycle of Components inside Angular is well documented and we have hook methods like ngOnInit(), ngDoCheck(), etc. Do we have similar lifecycle hooks for Angular Modules? Where can I…
Hivaga
  • 1,548
  • 2
  • 12
  • 23
4
votes
1 answer

ng2-intl - Error encountered resolving symbol values statically

I realise this is a common issue, but I can't figure out an implementation that works. I am using Angular 4.2.6 with ng2-intl 2.0.0-rc.3. I have tried the following and it is still not working: export function intlFactory(http:Http) { return new…
williamsandonz
  • 13,581
  • 21
  • 88
  • 171
4
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
  • 499
  • 1
  • 11
  • 29
4
votes
1 answer

Angular 2 app structure / Core Module and Third Party Libraries

I try to find a good way to structure my Angular 2 app. The Angular 2 styleguide recommends the creation of a core module. If I understand right the goal of the core module is to collect single-use classes and components and keep the root module…
Trafalgar
  • 296
  • 1
  • 2
  • 13
4
votes
0 answers

Ng2 lazy load module dependency in a lazy loaded module

I have an larger editor.module which is required by two lazy loaded modules a.module and b.module. It like to move the editor away from app.module. Is it anyhow possible to define a third lazy loaded module editor.module as a lazy loaded dependency…
Manuel
  • 8,016
  • 12
  • 56
  • 93
4
votes
1 answer

How can I get metadata for the current module in Angular 2?

I want to get the metadata for the current NgModule in order to get the list of declarations and providers in order to fill in a dynamic module I create to display components in a modal. How can that be done?
Andre Soares
  • 1,518
  • 2
  • 18
  • 24
4
votes
2 answers

Angular2: separation all services to one module

I have my own applicaton, written in Angular2, consist of several modules. To keep order in code, I found that I should isolate all services (for communication with API) to separate module. I wonder if it's good idea? Can it have an impact on…
Jaroslaw K.
  • 5,016
  • 1
  • 31
  • 56
4
votes
1 answer

Where can I get a list of all possible angular2 imports in ngModule?

So we have a code like this to bootstrap an app. @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) We import BrowserModule. But what is BrowserModule? Api reference doesn't give…
Alex Polymath
  • 165
  • 1
  • 9
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
  • 2,568
  • 6
  • 21
  • 47
1 2
3
8 9