here is my folder structure and i want to import PolicyDetail class to Policy.Service class how can i do that here im tired following code
in my Policy.Service class :
import { PolicyDetail } from '/App/Shared/PolicyDetail';
folder structure
App
-- Shared/
- PolicyDetail.ts
--Quote/
-Services /
-- Policy.Service.ts
Imports are always relative to the current file's location. That means you have to specify how to get to PolicyDetail from Policy.Service. It would be something like this.
import { PolicyDetail } from '../../Shared/PolicyDetail';
Demistification:
We start from the location of Policy.Service that being the Service folder.
We go to the parent (../) and end up in the Quote folder.
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.