简体   繁体   中英

In Angular 2.4, failed to import a feature module from a different project to the main project

I have two projects, one is the main project and the second project is a shared project. Inside the shared project I have created a feature module called NavBar.

The reason why we separated into different projects is so that we can reuse the NavBar module in different projects.

I want to import the NavBar feature module to the main project by using

import { NavBarModule } from '../../SharedProject/app/shared/navbar/navbar.module'

Unfortunately, I'm getting an error which says it tries to import using a get method

(SystemJS) XHR error (404 Not Found) loading http://localhost/ShareProject/app/shared/navbar/navbar.module

May I ask the proper way to do this?

It is hard to say what could be wrong with your code, you haven't provide enough information/code.

Maybe this would be helpful:

Angular 2 - moving modules to their own project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM