Import via Absolute Paths in Angular

The Solution

{
...
"compilerOptions": {
"baseUrl": "./",
...
},
...
}
{
...
"compilerOptions": {
"baseUrl": "./",
...
},
"paths": {
"@environments/*": ["./src/environments/*"]
},
...
}
{
...
"compilerOptions": {
"baseUrl": "./",
...
},
"paths": {
"@environments/*": ["./src/environments/*"],
"@shared/*": "["./src/app/shared/*"]
},
...
}

Conclusion

--

--

--

Full-stack software engineer specializing in web and mobile development. Always learning new things. “There is no growth in the comfort zone…”

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Diversifying Angular app — multi-lingual support

JavaScript 5 Review

Restarting Webserver (Httpd) Service is not idempotence in nature

Why build your forms with Redux-Form

How to add and remove multiple CSS classes simultaneously from a DOM node

Adding a Custom Tab Bar to Your Mini Program

React useState Hook

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jacob Neterer

Jacob Neterer

Full-stack software engineer specializing in web and mobile development. Always learning new things. “There is no growth in the comfort zone…”

More from Medium

How to disable events in Angular — Fran Prieto

Loading Configuration Before Angular App starts…

Angular Best Practices — 2022

Angular

What is new in Angular 14?

A cover image that contains Angular logo and “What is new in Angular 14” text