Questions tagged [angular2-modules]
132 questions
0
votes
1 answer
In Angular 2.4, failed to import a feature module from a different project to the main project
I have two projects, one is the main project and the second project is a shared project. Inside the shared project I have created a feature module called NavBar.
The reason why we separated into different projects is so that we can reuse the NavBar…
![](../../users/profiles/7444323.webp)
M. Dy
- 1
- 1
0
votes
0 answers
Angular 2: Where is the break in chain of modules?
I have a module that I'm calling home.module which I have routed into my app.module in the root folder. As things keep growing the home.module is becoming more massive. Naturally I went to create more modules to branch into it but for some reason…
![](../../users/profiles/1850272.webp)
Optiq
- 1,982
- 1
- 20
- 49
0
votes
2 answers
Working with layouts in Angular2 app
I have developed an Angular2 app using routing.
My problem scenario is:
I have a Login page which has different HTML and CSS.Once successfully logged in, I redirect to another page which has different HTML and CSS.
But I have index.html(login page)…
![](../../users/profiles/4811951.webp)
Jayakrishnan
- 3,724
- 2
- 17
- 29
0
votes
1 answer
angular2 router interpreting route as parameter?
I am trying to route to a child module with route params, my app.routes looks like
import { Routes, RouterModule } from '@angular/router';
const appRoutes: Routes = [
{ path: 'cell', loadChildren: './cell/cell.module#CellModule', pathMatch:…
![](../../users/profiles/4620733.webp)
George Edwards
- 8,017
- 16
- 64
- 135
0
votes
3 answers
How can I use a component that was defined in my core module from a lazy route?
I have a component that I would like to reuse in a few places throughout my applications. As such, I created a module within my core module with new component. The error I'm getting is 'foo' is not a known element.
You can see a demo here. You will…
![](../../users/profiles/3665348.webp)
onetwothree
- 612
- 9
- 19
0
votes
2 answers
Angular 2 call child selector from one child module into child module
I have a directory structure of:
|-resources
|-views
|-Typescript
|-App
|-app.module.ts
|-app.component.ts
|-Modules
|-Core
|-Assets
|-Typescript
|-core.module.ts
…
![](../../users/profiles/3887342.webp)
PaladiN
- 3,842
- 4
- 34
- 61
0
votes
1 answer
One Service with variable in many ngModule
It's not really a problem but it's a question :
In a test project, I try to use ng2-translate in multiple ngModule with a same TranslateService.
package.json :
"ng2-translate": "^4.0.0"
It's not working, for every module I must to declare a new…
![](../../users/profiles/7133926.webp)
Eltron
- 45
- 2
- 8
0
votes
1 answer
Multiple bundling for every ngModule with rollup.js Angular 2
I checked some articles about rollup.js and looks like it is pretty interesting module loader with cool bundle possibility. But, actually, I didn't see how it can be configured to multiple angular 2 modules bundling. For example: I have 10 modules…
![](../../users/profiles/5232122.webp)
Velidan
- 3,891
- 2
- 34
- 63
0
votes
1 answer
Angular 2 can't use custom directive
This is the shared module which I share across my app:
@NgModule({
imports: [
CommonModule,
ModalModule
],
declarations: [],
exports: [
ModalModule
]
})
export class SharedModule {}
This shared module imports…
![](../../users/profiles/4054974.webp)
Chrillewoodz
- 22,596
- 18
- 73
- 147
0
votes
0 answers
Why index.ts AND modules in Angular 2?
I get the concept of a barrel that let's you import a directory using the index.ts convention.
What I don't get is why the index.ts always seems to export * from the component.ts file.
Shouldn't it use the module.ts file to get all the…
![](../../users/profiles/467240.webp)
mtyson
- 7,100
- 13
- 56
- 97
-1
votes
1 answer
ERROR in ./src/app/app.module.ts Module not found
I'm working on angular-cli. I got following errors.
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '@angular/router/src/router_module' in
'E:\xampp\Angular-cli\Login\src\app'
@ ./src/app/app.module.ts 13:0-69
@…
![](../../users/profiles/5703595.webp)
Zeeshan Malik
- 327
- 1
- 8
- 21
-1
votes
2 answers
A Module in Angular (2+) should be an App by itself created with angular-cli?
I want to separate the login/register workflow into an isolated module. So far I created the module (ng g module login-module) and I want to add the Facebook and Google SDKs to it.
The thing is, the main module (AppModule) is the responsible for the…
![](../../users/profiles/1664599.webp)
forkfork
- 365
- 4
- 17