-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular project can't find package: src
- Solved
#738
Comments
@linhub15 does it also work w/ the Angular CLI? I think we disabled absolute paths bc it wasn't supported in the newer versions of Ang CLI, but can investigate otherwise |
No need to enable absolute paths in Angular, I think this is more of a Typescript / Javascript file import thing.
Argument for absolute paths
EmployeeComponent imports the ApiService Projects with deep directory structures benefit from absolute import paths. |
yes i have the same issue and it resolved by adding relative path. |
but it doesn't work me!!! |
Still having this problem, any ideia how to fix ? |
I did try the relative path. But its not working still the same error. |
For anyone that runs into this issue.
Using absolute paths for Typescript
import
statements causes project to give an error.It works fine in VS Code locally, but not on Stackblitz.
Wrong: absolute import
import { Employee } from 'src/app/models/employee.model';
Right: relative imports
import { Employee } from '../models/employee.model';
I'm new to Angular so I'm not sure what the best practices are.
The text was updated successfully, but these errors were encountered: