2017-04-11 2 views
2

각도 2 어플리케이션의 두 개의 개별 모듈에 공유 컴포넌트 "SimpleRadialChartComponent"를 포함하고 싶습니다.타입 Y는 2 모듈 선언의 일부입니다. - 각도 2

유형 SimpleRadialChartComponent 두 개의 서로 다른 모듈에서 공유 구성 요소를 선언 할 수있는 방법이 개 모듈

의 선언의 일부입니다 : 나는 각 모듈의 선언 영역에이 구성 요소를 전달하는 경우,이 오류를했다?

+0

당신은 몇 가지 코드로 우리를 계몽 할 수 있습니까? –

답변

4

좋은 연습은 두 개 이상의 모듈을 사용하여 구성 요소, 모델 객체 등에 대한 "공유"모듈을 만드는 것입니다.

official documentation에있는 모든 가이드 라인과 우수 사례. 문제의


자세한 설명, 당신은 here을 찾을 수 있습니다

If you want to use a component across multiple modules, you'll need to create a "shared" module and add that component the shared module's exports. Then you add that shared module into your other modules imports.