How to Include moment-timezone in Angular 2 App

前端 未结 6 509
别跟我提以往
别跟我提以往 2020-12-31 00:05

I realize, this question is repeated but previous once does not provide apt answer moment package was already installed

1.Installed package

6条回答
  •  悲&欢浪女
    2020-12-31 00:17

    To install moment-timezone for Angular in 2018:

    1. Install moment.js and moment-timezone

      npm install moment moment-timezone @types/moment-timezone --save

    2. Import these modules in your .ts file

      import * as moment from 'moment'; import 'moment-timezone';

    Github issue: How to resolve the 'tz' build error.

提交回复
热议问题