0

I'm looking for a component library for my Angular 6 project, I'm trying to test the ngx-materialize however I'm getting error with the DatePicker and TimePicker components, as following:

ERROR TypeError: Cannot read property 'apply' of undefined at RendererAdapter.push../node_modules/@angular/core/fesm5/core.js.RendererAdapter.invokeElementMethod (core.js:8826) at MzTimepickerDirective.push../node_modules/ngx-materialize/fesm5/ngx-materialize.js.MzTimepickerDirective.initTimepicker (ngx-materialize.js:5475) at MzTimepickerDirective.push../node_modules/ngx-materialize/fesm5/ngx-materialize.js.MzTimepickerDirective.ngOnInit (ngx-materialize.js:5416) at checkAndUpdateDirectiveInline (core.js:9042) at checkAndUpdateNodeInline (core.js:10306) at checkAndUpdateNode (core.js:10268) at debugCheckAndUpdateNode (core.js:10901) at debugCheckDirectivesFn (core.js:10861) at Object.eval [as updateDirectives] (ContentEditPageComponent.html:22) at Object.debugUpdateDirectives [as updateDirectives] (core.js:10853)

Following my styles and script of my 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"
]

Following the dependencies of 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"
  }

Can anyone tell me what is wrong?

Thanks.

3
  • Did you add your material module to your root module Commented Jul 20, 2018 at 16:55
  • Yes, following my app.module import imports: [ BrowserModule, HttpClientModule, BrowserAnimationsModule, MatTabsModule, MatDatepickerModule, MatInputModule, MatNativeDateModule, MatSliderModule, FormsModule, AppRoutingModule, SocialLoginModule, MzDatepickerModule, MzTimepickerModule, MzButtonModule, MzInputModule, FroalaEditorModule.forRoot(), FroalaViewModule.forRoot(), MDBBootstrapModule.forRoot() ],
    – Flávio
    Commented Jul 20, 2018 at 17:53
  • did you find any solution?
    – Wrong
    Commented May 25, 2019 at 23:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.