It would be very useful to be able to address components via a relative path starting at the project root. A way to do this is to consider the project root as a special project, as if it was inside of node_modules as far as resolution is concerned.
Such a design greatly reinforces the 'app as a library' idea, and plays nice with most module loading scheme.
A proposed name is @app but configurable via angular-cli.json, where app is the project prefix specified in ng new --prefix app (this exists already and defaults to app).
Example:
// instead of
import { something } from '../../../../../../../shared/something';
// we could do
import { something } from '@app/shared/something';
It would be very useful to be able to address components via a relative path starting at the project root. A way to do this is to consider the project root as a special project, as if it was inside of
node_modules
as far as resolution is concerned.Such a design greatly reinforces the 'app as a library' idea, and plays nice with most module loading scheme.
A proposed name is
@app
but configurable viaangular-cli.json
, whereapp
is the project prefix specified inng new --prefix app
(this exists already and defaults toapp
).Example:
This would also work for CSS preprocessors.
Such implementation would address https://github.com/angular/angular-cli/issues/865 and also greatly reduce the need for https://github.com/angular/angular-cli/issues/900.