I have a module problem between ng2 applications. Here is a very simple script to demonstrate the problem. Using angular-cli completely:
- There is a SharedModule application created using
ng new SharedModule . - There is a MyApp application created using
ng new MyApp . - The module in the SharedModule application exports a custom component (which I would like to use in the MyApp application).
- The main module in MyApp imports the module from the SharedModule application.
- When you try to start MyApp using
ng serve it is deleted with an error:An error encountered character resolution values. Call function 'makeDecorator', function calls are not supported. Consider replacing a function or lambda with a link to an exported function ... 
Omitting not very important material, the basic structure looks like this:
MyApp |โโโโangular-cli.json |โโโโpackage.json | โโโsrc โโapp |โโโโapp.module.ts |โโโโapp-root.component.ts โโ SharedModule |โโโโangular-cli.json |โโโโpackage.json | โโsrc โโapp |โโโโapp-root.component.ts |โโโโcustom-input.component.ts |โโโโshared.module.ts โโ
The key point here is that MyApp and SharedModule are two different applications. If I try to put the general module inside MyApp (along with the exported custom component), then it will work fine. Unfortunately, this is not an option now, and I have to keep the modules / applications separate. Also, creating an npm package from SharedModule and installing it in MyApp is not an option.
I created a github repository demonstrating the problem. To run it:
- run
npm install in the MyApp and SharedModule folders. - run
npm start in the MyApp folder.
A million dollar question is how can I do this? Thanks.
source share