Skip to content

angular4 autoimport problem #17705

@mjbvz

Description

@mjbvz

From @GilHyeon on August 8, 2017 5:29

I wrote code Angular4 with vscode. some module auto import is wrong.

for example, Routes, RouterModule auto import like this

import { Routes, RouterModule } from "@angular/router/router";

but it's not correct. this is correct import statement

import { Routes, RouterModule } from "@angular/router";

this problem have also 'angular/forms' modules import

// wrong import
import { FormGroup } from "@angular/forms/forms";

// correct import 
import { FormGroup } from "@angular/forms";
  • VSCode Version: 1.14.2
  • OS Version: MacOS 10.12.5(16F73)

Steps to Reproduce:

  1. wrote Routes and click yellow lamb.
  2. select import but there is no correct import statement
  • this step has 3 recommend statements
 import { Routes } from "@angular/router/src";
 import { Routes } from "@angular/router/public_api";
 import { Routes } from "@angular/router/router";
  1. I select third statement. but it occurred build error.
  2. I changed statement correctly
import { Routes } from "@angular/router
  1. next, RouterModule add auto import is done correctly like this
import { Routes, RouterModule } from "@angular/router";

Reproduces without extensions: Yes

Copied from original issue: microsoft/vscode#32120

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions