0

I am very new to angular. I am having an issue calling a type script module in different folder. I have the following structure in my angular project. My angular project and my .net core project exists in the same application. Below is the image:

enter image description here

whenever I am calling my type script class that exists inside models folder from any other folder, I get an error saying "cannot found module 'src/modules/acrDivison' so for e.g. if I call acrDivison.ts that exists inside models from add-project/add-project.componet.ts by the below statement

import { AcrDivison } from 'src/models/acrDivison';

then I get an error saying "cannot found module 'src/modules/acrDivison'.

any help in this regard will be appreciated.

2 Answers 2

1

You have to move up two steps to be in src directory then write the dir to the AcrDivision module

import { AcrDivison } from '../../models/acrDivison';
Sign up to request clarification or add additional context in comments.

Comments

0

Make sure what your component have this:

export class AcrDivison implements OnInit { }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.