0

I built an Angular application [MASTER]. Inside of it, I would like to import another application built with a feature module [FEATURE_MODULE].

To generate the FEATURE_MODULE, I followed this tutorial: Modules tutorial. This exports a feature module called 'SharedModule' (see tutorial). I included the EagerComponent to this module in order to be imported into the MASTER.

By other hand, I followed the steps mentioned inside this another tutorial to generate a library component (bundle): How to build a component tutorial

Finally, I imported that component into MASTER but when I run it, Angular shows the below message.

My question is:

How can I import, and use, a component which is included inside a feature module?

App.module.ts:

imports: [... , SharedModule.forRoot(), ...],
declarations: [.., EagerComponent, ...]

The 'EagerComponent' is the component which I would like to use into MASTER.

Output:

looking for modules in C:\entorno\diciembreALG\src

using description file: ...\package.json (relative path: ./src)

Field 'browser' doesn't contain a valid alias configuration after using description file: ...\package.json (relative path: ./src)

using description file: ...\package.json (relative path: ./src/lazy-eager/src/app/eager.component) no extension

Field 'browser' doesn't contain a valid alias configuration C:\entorno\diciembreALG\src\lazy-eager\src\app\eager.component doesn't

exist .ts Field 'browser' doesn't contain a valid alias configuration ...\src\lazy-eager\src\app\eager.component.ts doesn't exist

.js Field 'browser' doesn't contain a valid alias configuration ...\src\lazy-eager\src\app\eager.component.js doesn't exist

as directory ...\src\lazy-eager\src\app\eager.component doesn't exist

Angular version:

Angular CLI: 1.6.1

Node: 9.1.0

OS: win32 x64

Angular: 5.1.1

... animations, common, compiler, compiler-cli, core, forms

... http, language-service, platform-browser

... platform-browser-dynamic, router

@angular/cdk: 5.0.1

@angular/cli: 1.6.1

@angular/material: 5.0.1

@angular-devkit/build-optimizer: 0.0.36

@angular-devkit/core: 0.0.22

@angular-devkit/schematics: 0.0.42

@ngtools/json-schema: 1.1.0

@ngtools/webpack: 1.9.1

@schematics/angular: 0.1.11

@schematics/schematics: 0.0.11

typescript: 2.4.2

webpack: 3.10.0

0 Answers0