Let say I have following component:
@Component({})
export class ServerComponent {
}
When typing @Component
, Visual Studio Code suggest me to auto import @angular/core
module. I accepted and get this import:
import { Component } from "../../../node_modules/@angular/core";
When I watch online courses, I see when the mentor perfomed the same actions he got much shorter path:
import { Component } from "@angular/core";
My app work OK for both paths, but I want to know how this happen, just for curious.
Questions:
- Why my import path is different?
- Is there any config that control this behavior?
- Does this effect any behavior of my app?
My enviroment:
- Windows 10 Pro x64
- Visual Studio Code 1.25.1
- NPM 5.6.0
- Node 8.11.3
- Angular CLI: 6.0.8 (npm install -g @angular/cli)
- Angular 6.0.9
Mentor's environment:
- Mac OSX
- Visual Studio Code
- Angular CLI 6.0.0 (npm install -g @angular/cli)