2

I have two projects both developed in Angular 2, let say first project is test-core and second project is test-sail. Both the project structures have been created using Angular-cli. test-core structure: enter image description here

test-sail structure: enter image description here

If you look at the app.module.ts in the test-sail, where we are importing AppComponent of test-sail, I want to import AppComponent of test-core and I was doing something like this (after running both the application on the local server):

import { AppComponent } from 'http://localhost:4200/test-core/src/app/app.component';

but this didn't work. If I directly hit that url it works. Is it possible to load a component from one Angular project to another. If yes please help me out.

Thanks in advance.

Community
  • 1
  • 1

1 Answers1

-1

I think the simplest way would be to copy/paste the directory in your new angular project.

Gnujeremie
  • 570
  • 3
  • 17
  • 1
    Please elaborate with more details this is not appropriate answer – The Hungry Dictator Nov 15 '16 at 08:52
  • We have projects in two different servers, the project does not have a common parent. They are independent of each other. – Ammar Tinwala Nov 15 '16 at 09:11
  • 1
    @RonakBhatt for me the solution is to duplicate your module in each project. The caveat being if you need to update your module, then you have to update it in every project. Or it must be possible to use npm to install the module, by publishing it or using npm and git / github (http://stackoverflow.com/questions/17509669/how-to-install-nodejs-package-from-github-directly) – Gnujeremie Nov 16 '16 at 09:24