Import two exported classes with the same name

前端 未结 1 1158
醉梦人生
醉梦人生 2020-12-29 01:02

In typescript, using Angular 2, I need to import two classes with the same name, but lying in different paths.

The project is quite too big that I find it hard to ch

1条回答
  •  我在风中等你
    2020-12-29 01:29

    You can use as like this:

    import {Class1} from '../location1/class1'
    import {Class1 as Alias} from '../location2/class1'
    

    You can find more about the ES6 import statement here.

    0 讨论(0)
提交回复
热议问题