NG2 duplicate module name

2019-09-12 09:05发布

问题:

Using ng2 calendar module from PrimeNG (link) and open source calendar.

import {CalendarModule} from "primeng/components/calendar/calendar"; import {CalendarModule} from 'angular-calendar';

How can I import both modules into mine?

Now TS says Duplicate identifier 'CalendarModule'.

回答1:

You can give an alias in typescript import. Try

import { CalendarModule as c }  from "primeng/components/calendar/calendar";