In one Angular 9 project I noted that some ng modules names starts with @ symbol. It makes module available for other modules using it's path starting from @ like absolute path. It's very handy for @core module, because you don't need to figure out the corresponding relative path when you want to use it in other modules. What is the name of this feature? I want to know more about it.
Asked
Active
Viewed 36 times
0
-
Are you talking about the "@" in "@angular/core" ? – Marco Dec 14 '20 at 08:03
-
1You're probably looking at NPM scoped packages: https://docs.npmjs.com/cli/v6/using-npm/scope – Edric Dec 14 '20 at 08:05
-
2It's called TypeScript path mapping and it's a TypeScript feature, not an Angular feature: https://www.typescriptlang.org/docs/handbook/module-resolution.html You don't need the `@`. It's just a convention. – Thomas Sablik Dec 14 '20 at 08:06
-
Seems like it's scoped packages.Thank you. – Dmitriy Kudinov Dec 14 '20 at 08:10
-
1_"Seems like it's scoped packages."_ In that case the question is wrong. `@core` is not a scope or a scoped package. `@angular/core` is a scoped package and `@angular` is a scope. – Thomas Sablik Dec 14 '20 at 08:12
-
@core is the module I created – Dmitriy Kudinov Dec 14 '20 at 08:14
-
1_"@core is the module I created"_ In that case it's not scoped package but path mapping. Scoped packages are installed with `npm` under `node_modules`. – Thomas Sablik Dec 14 '20 at 08:15
-
Right, it's path mapping, like in link you provided. Thank you. – Dmitriy Kudinov Dec 14 '20 at 08:17
-
@ThomasSablik You should post your comment as an answer. – Marco Dec 14 '20 at 09:44
-
It's a duplicate. You shouldn't answer duplicates. The other question contains very good answers. You should vote to close. – Thomas Sablik Dec 14 '20 at 09:59