If you have two angular-cli projects in one solution, is it possible to import components/modules into the angular-cli 1 project from the angular-cli 2 project, and if possible, how could this be done.
-
1I would be more specific as to what a solution is, as someone who uses asp.net I assume you mean a Visual Studio Solution, however; I would also note that the fact it is in a Solution has no bearing on this question, maybe you should update the question in a way that serves anyone working on a project with multiple Angular CLI projects. IMHOEric Bishard– Eric Bishard2017-09-13 17:50:38 +00:00Commented Sep 13, 2017 at 17:50
Add a comment
|
1 Answer
You can one project as a dependency. Take a look at Primefaces PrimeNG. It is a angular2 based library. It just exports some modules/components that you can use in your app.
You can also get interest in subapps (see https://github.com/angular/angular-cli/issues/761)
5 Comments
user1441610
Ok I export the module as i.e. PrimeNG accordion, but how do I access/import them from the other angular-cli project
user1441610
And how do i make angular-cli 1 project dependent on angular-cli 2 project?
jmachnik
add it as a npm module, the webpack should bundle it
user1441610
As you understand I'm new to angular and webpack, so I need to ask how to create an nmp module of the angular-cli 2 project, and then how to reference this locally in angular-cli 1 package.json
jmachnik
It seems to be an architecture issue. Because you can make a project with components shared between those two applications. Then you just add something like this to package.json { “name”: “my-app”, “dependencies”: { “lodash”: “^2.0.0”, “my-module”: “file:local_modules/my-module”, } } it's from medium.com/@arnaudrinquin/…