Questions tagged [angular2-modules]
132 questions
2
votes
0 answers
How to use spread operator with export keyword
Given the following:
@NgModule( {} )
export class ServicesModule {
static forRoot() {
return {
ngModule: ServicesModule,
providers: [ ...moduleProviders ]
}
}
}
const moduleProviders = [ CountryService,…

st_clair_clarke
- 5,453
- 13
- 49
- 75
2
votes
2 answers
Having trouble exporting from an Angular2 module
I'm a beginner with Angular 2, and am trying to understand how to export a class from a feature module, and import it into my main module.
When I try to compile this in typescript, I receive the following two errors:
app/app.component.ts(11,21):…

Ketchup201
- 129
- 1
- 9
2
votes
1 answer
Angular2 RC5 Cross-Module Provider / Scanning
I'm working on a project which is currently Angular RC5 and Material Design latest. Not that the last part is relevant.
I'm starting to create separate modules and move away from having everything in the main Module because of obvious reasons. I…

Mathijs Segers
- 6,168
- 9
- 51
- 75
1
vote
1 answer
How can I create an Angular 7 app being prepared to extract reusable ng modules?
I am creating (actually rewriting
ng 5 app) an Angular app and want to keep reusable self contained modules prepared to reuse.
I’d like to do a minimum first step to have separate my.org folder along with an app and put all the modules there each…

ciekawy
- 2,238
- 22
- 35
1
vote
0 answers
Angular 5 dynamic module loading
I am trying to create an application in which I want to load feature modules in as separate webpack chunks which will be compiled in a separate project. The Webpack part I have taken care of and it is working fine. The HTML order of the script…

Himanshu Gupta
- 21
- 4
1
vote
1 answer
How to import module in the current project from different Directory in Angular 2 Typescript
In The above image angular2-template is my Angular 2 project.
I have defined ContactModule in the common-template folder.
How can I import ContactModule from common-template into angular2-template?

Parul Jain
- 11
- 3
1
vote
1 answer
angular 2 AOT compilation
I want to compile my angular 2 projects with AOT.
ng build --prod --aot
gives this error;
ERROR in Unexpected value 'null' imported by the module 'AppModule in D:/Git/ng_v4_aot/src/app/app.module.ts'
Are there any initial configurations before…

yashodha_h
- 944
- 3
- 9
- 23
1
vote
1 answer
Isotope v2 with Angular cli
I'm exepiencing problems using isotope-layout module with angular cli
I installed the module with
npm install isotope-layout --save
and I added the script in my .angular-cli.json file
"scripts": [
...
…

Shyghar
- 313
- 4
- 19
1
vote
1 answer
Modules in Angular 2(4)
I have been reading over the seed template for Angular 2 projects and have a question about when to have a module vs components inside a larger module. I understand it it reccommended to create modules per feature but am having a hard time coming to…

Isaac Levin
- 2,809
- 9
- 49
- 88
1
vote
2 answers
Using Angular 2+ forRoot pattern to pass callbacks into modules
I have created an Angular Module called DataModule which contains services for accessing my backend through a token-secured HTTP API. On HTTP access control errors such as 401 Unauthorized and 403 Forbidden I want to be able to redirect to /login or…

the-a-train
- 1,123
- 13
- 32
1
vote
0 answers
angular2-meteor feature module import error: Uncaught TypeError: Cannot read property 'replace' of undefined extractStyleUrls
created angular2 feature module when import module to main app.module, getting below error
modules.js?hash=83df0dc…:35050 Uncaught TypeError: Cannot read property 'replace' of undefinedextractStyleUrls @ modules.js?hash=83df0dc…:35050(anonymous…

Hanumanthraju
- 77
- 1
- 2
- 11
1
vote
2 answers
Angular 2 + Lazyloaded Module is being overridden by an imported module
I would like to know how to import a module without it taking priority over the parent module. I am trying to understand why my imported module is overriding the parent modules entry component. I import the QuotesModule into my CompaniesModule so…

Rex
- 376
- 2
- 11
1
vote
1 answer
'Cannot find module' with Angular2 lazy loading
Having trouble with implementing routing in combination with lazy loading.
My code can be found here: https://github.com/ahartvign/NetCoreDemos
Whenever I try to navigate to my lazy loaded route 'tracking', I get the error:
Cannot find module…

Alexander Hartvig Nielsen
- 55
- 1
- 6
1
vote
0 answers
How to hide angular2 module implementation for particular user role in Angular2 + ASP.NET MVC application?
In the application i should ensure that particular user role, can't see some component implementation, that was designed for other user roles (admin must see everything, and user shouldn't see admin specific stuff).
What would be the best practice…

Sergejs
- 2,540
- 6
- 32
- 51
1
vote
0 answers
how to define the entry component in the child module ?
I want to set the entry component in the user child module. It doesn't work. But, when i set it in the parent app module, it's work correctly. why ???
//User module
@NgModule({
imports: [],
exports: [UsersFormsComponent],
declarations:…

drtapha
- 539
- 1
- 7
- 15