ngx-materialize DatePicker和TimePicker无法读取未定义的属性“ apply”

时间:2018-07-20 16:14:31

标签: angular materialize

我正在为Angular 6项目寻找组件库,正在尝试测试ngx-materialize,但是DatePicker和TimePicker组件出现错误,如下所示:

  

错误TypeError:无法读取未定义的属性“ apply”       在RendererAdapter.push ../ node_modules/@angular/core/fesm5/core.js.RendererAdapter.invokeElementMethod中   (core.js:8826)       在MzTimepickerDirective.push ../ node_modules / ngx-materialize / fesm5 / ngx-materialize.js.MzTimepickerDirective.initTimepicker   (ngx-materialize.js:5475)       在MzTimepickerDirective.push ../ node_modules / ngx-materialize / fesm5 / ngx-materialize.js.MzTimepickerDirective.ngOnInit   (ngx-materialize.js:5416)       在checkAndUpdateDirectiveInline(core.js:9042)       在checkAndUpdateNodeInline(core.js:10306)       在checkAndUpdateNode(core.js:10268)       在debugCheckAndUpdateNode(core.js:10901)       在debugCheckDirectivesFn(core.js:10861)       在Object.eval [作为updateDirectives](ContentEditPageComponent.html:22)       在Object.debugUpdateDirectives [作为updateDirectives](core.js:10853)

按照我的angular.json样式和脚本

"styles": [
  "node_modules/font-awesome/scss/font-awesome.scss",
  "node_modules/angular-bootstrap-md/scss/bootstrap/bootstrap.scss",
  "node_modules/angular-bootstrap-md/scss/mdb-free.scss",
  "node_modules/froala-editor/css/froala_editor.pkgd.min.css",
  "node_modules/froala-editor/css/froala_style.min.css",
  "node_modules/materialize-css/dist/css/materialize.min.css",
  "src/styles.scss"
],
"scripts": [
  "node_modules/chart.js/dist/Chart.js",
  "node_modules/hammerjs/hammer.min.js",
  "node_modules/jquery/dist/jquery.js",
  "node_modules/froala-editor/js/froala_editor.pkgd.min.js",
  "node_modules/materialize-css/dist/js/materialize.js"
]

遵循package.json的依赖关系

 "dependencies": {
    "@angular/animations": "^6.0.7",
    "@angular/cdk": "^6.3.2",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/material": "^6.3.2",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "@mdi/font": "^2.5.94",
    "@types/jquery": "^3.3.4",
    "angular-6-social-login": "^1.1.1",
    "angular-bootstrap-md": "^6.1.6",
    "angular-froala-wysiwyg": "^2.8.4",
    "angular2-materialize": "^15.1.10",
    "angular5-csv": "^0.2.10",
    "chart.js": "^2.5.0",
    "core-js": "^2.5.4",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.3.1",
    "materialize-css": "^1.0.0-rc.2",
    "ngx-materialize": "^6.0.1",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.8",
    "@angular/cli": "~6.0.8",
    "@angular/compiler-cli": "^6.0.3",
    "@angular/language-service": "^6.0.3",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~2.7.2"
  }

谁能告诉我出什么问题了?

谢谢。

0 个答案:

没有答案