R
R
RemonKh2017-10-19 16:59:08
Angular
RemonKh, 2017-10-19 16:59:08

How to include a component from another directory not in the current project in Angular 2?

Is it possible to import components from outside, for example from another project that is in a different folder.
That is, something like import { TestComponent } from '/home/user/myprojest/comonents/test/components';

Answer the question

In order to leave comments, you need to log in

3 answer(s)
U
Urukhayy, 2017-10-19
@Urukhayy

Theoretically, yes.

V
Volodymyr Vladimirovich, 2017-10-21
@Terminos

Perhaps if you configure the angular cli correctly.
In general, if you need to load a component in this way, something has gone wrong. Why?
The component was not transferred to the current project, so as not to drag dependencies?
If one component is needed on both projects, it can be abstracted and taken out as a library and connected through dependencies.

R
RemonKh, 2017-10-25
@RemonKh

So it is necessary to connect common components, i.e. the idea is to create a library of components that can be used in different projects.
Terminos, and it is possible about dependencies in more detail?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question