我正在使用 moment.js
更改我的应用程序的本地日期格式,但出现以下错误:
"moment" has no exported member 'default' when importing the library.
下面是我的代码:
import {Inject, Injectable, Optional} from '@angular/core';
import {DateAdapter, MAT_DATE_LOCALE, MatDateFormats} from '@angular/material';
import * as _moment from 'moment';
import {default as _rollupMoment, Moment} from 'moment';
const moment = _rollupMoment || _moment;
最佳答案
尝试将 "allowSyntheticDefaultImports": true
添加到 "compilerOptions"下的 tsconfig.json
关于angular - "moment"没有导出成员 'default',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54766706/