angular5.x + ng-zorro-antd 0.7.0 引入日历组件报“Missing locale data for the locale 'zh-cn'”错误

angular5.x + ng-zorro-antd 0.7.0 引入日历组件报“Missing locale data for the locale 'zh-cn'”错误

Version
angular5.x
ng-zorro-antd 0.7.0

解决办法:
要正常显示日历组件,必须导入正确的语言环境包。
在当前组件引入以下代码即可:

import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
registerLocaleData(zh);

angular5.x + ng-zorro-antd 0.7.0 引入日历组件报“Missing locale data for the locale 'zh-cn'”错误:等您坐沙发呢!

发表评论

表情
还能输入210个字