Hello,
I noticed in so many places the '@' sign is being used when importing classes from the @shared and others.
How can one add this '@' to his own code? Anything special needed to make all my imports (code I write) make use of '@'?
Thanks
6 Answer(s)
-
0
Hi,
I think you are talking about angular4 project. If so, you can check this document <a class="postlink" href="https://docs.npmjs.com/getting-started/scoped-packages">https://docs.npmjs.com/getting-started/scoped-packages</a>
Thanks.
-
0
Thanks for the link.
I assume you have created a similar open per folder? For instance you use @shared and others like that.
In the document it says one scoped package per project. In your case you have more than one @ almost for each folder.
Thanks
-
0
Hi,
Yes, you can use path aliases like this <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/tsconfig.json#L19">https://github.com/aspnetzero/aspnet-ze ... g.json#L19</a>
Thanks.
-
0
Thanks a lot.
So you are telling typescript that this alias maps to this or that path correct?
-
0
Yes, exactly :)
-
0
Thanks a lot.