角度模块'“ C:/ xxxxx / customNgbDateParserFormatter没有导出的成员CustomNgbDateParserFromator

时间:2019-03-28 17:54:40

标签: angular

我使用NgbDatePicker - How to bind longDate string to [ngModel]?的帮助创建了一个自定义类。 代替MyNgb ...我直接在Vs Code中使用右键单击->创建文件->将其命名为customNgbDateParserFormatter,尽管当您打开文件时,类名是CustomNgbDateParserFormatter。然后,我将其添加为app.module.ts中的提供者,如下所示。在编译时,出现以下错误:模块C:/ users .... customNgbDateParserFormatter没有导出的成员'CustomNgbDateParserFormatter' App.module

  import {NgbModule, NgbDateParserFormatter} from '@ng-bootstrap/ng- 
     bootstrap';
  import { CustomNgbDateParserFormatter } from './custom- 
  screen/customNgbDateParserFormatter';

 providers: [{provide: NgbDateParserFormatter, useFactory: () => new 
   CustomNgbDateParserFormatter('longDate')}],

0 个答案:

没有答案