Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.0.1
node: 7.9.0
os: darwin x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.3
Repro steps.
- Create a module using
ng new or by any other means
- Export a module from the built code. E.g., you can do
@NgModule()
export class SimplestModule { }
inside of src/main.ts that gets generated by the new project.
- Create a second Angular project. Using
ng new is fine.
- Import the exported module in your new project.
import { SimplestModule } from '/path/to/other/module/dist/main.bundle';
@NgModule({
declarations: [ AppComponent ],
imports: [ SimplestModule ],
bootstrap: [AppComponent]
})
export class AppModule { }
If you import { SimplestModule } the result will be undefined. If you import SimplestModule (i.e. module.exports that gets created), you will get an undecorated object.
The log given by the failure.
From the project attempting to import:
Unexpected value XXX imported by the module 'AppModule'
Desired functionality.
You should be able to use ng to build modules that can be imported into other modules. Currently modules that are built do not appear to be ready to be imported by other modules post-build.
In general it would be nice to have more documentation / tools surrounding the creation of third party modules or modules that are intended to be reused by other modules.
Bug Report or Feature Request (mark with an
x)Versions.
@angular/cli: 1.0.1
node: 7.9.0
os: darwin x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.3
Repro steps.
ng newor by any other meanssrc/main.tsthat gets generated by the new project.ng newis fine.If you import
{ SimplestModule }the result will beundefined. If you importSimplestModule(i.e.module.exportsthat gets created), you will get an undecorated object.The log given by the failure.
From the project attempting to import:
Desired functionality.
You should be able to use
ngto build modules that can be imported into other modules. Currently modules that are built do not appear to be ready to be imported by other modules post-build.In general it would be nice to have more documentation / tools surrounding the creation of third party modules or modules that are intended to be reused by other modules.