没有Bs Datepicker中的'new',不能调用类构造函数BehaviorSubject

时间:2019-04-26 12:45:11

标签: javascript angular datepicker

“在打开日期选择器的类构造函数BehaviorSubject没有'new'时无法调用此错误。

1 个答案:

答案 0 :(得分:1)

我刚刚找到了解决方案,更改了我,以及为什么此错误向我显示。这是由于tsconfig.json更改

{
  "compileOnSave": false,
  "compilerOptions": {
    "importHelpers": true,
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es2018", //"target": "es5", => due to this change
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018", //"es2016",, => due to this change
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "preserveWhitespaces": false
  }
}