Answer the question
In order to leave comments, you need to log in
Why can't VSCode and Agnular see the classes in the models folder?
Good afternoon.
There are two classes in the models folder: product.ts and user.ts
In the component I try to include them: import {Product, User} from '../../models'.
Swears: Cannot find module '../../models'.
What am I doing wrong? because somewhere in the examples I saw that this is possible.
Yes, I can include them via import { Product} from '../../models/product.ts', but damn..
Answer the question
In order to leave comments, you need to log in
In the models folder, you need to create index.ts and describe the exports there: for example, export * from ./product.ts.
This is called barrel import.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question