meterial design javascript method from angular 7 componet

I am building a website in which i am using ‘creative tim template for dashbaord’
I am using date and time picker ,the issue i am facing is the datetime picker is initialized only once and ‘it worked when the component and loaded for the first time but when i switch components then datetime picker stop working’,

the solution that i’ve found out is i have to initilize datetimepicker every time component is loaded by using initialize method in component
but then i receive the error src/app/components/booktrip/booktrip.component.ts(24,5): error TS2304: Cannot find name ‘md’.

here’s my code

 ngOnInit() {
   md.initFormExtendedDatetimepickers(); // here i have the isssue
 }

My angular.json is

 "scripts": [
          "src/assets/js/core/jquery.min.js",
          "src/assets/js/core/popper.min.js",
          "src/assets/js/core/bootstrap-material-design.min.js",
          "src/assets/js/plugins/perfect-scrollbar.jquery.min.js",
          "src/assets/js/plugins/moment.min.js",
          "src/assets/js/plugins/sweetalert2.js",
          "src/assets/js/plugins/jquery.validate.min.js",
          "src/assets/js/plugins/jquery.bootstrap-wizard.js",
          "src/assets/js/plugins/bootstrap-selectpicker.js",
          "src/assets/js/plugins/bootstrap-datetimepicker.min.js",
          "src/assets/js/plugins/jquery.dataTables.min.js",
          "src/assets/js/plugins/bootstrap-tagsinput.js",
          "src/assets/js/plugins/jasny-bootstrap.min.js",
          "src/assets/js/plugins/fullcalendar.min.js",
          "src/assets/js/plugins/jquery-jvectormap.js",
          "src/assets/js/plugins/nouislider.min.js",
          "src/assets/cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.js",
          "src/assets/js/plugins/arrive.min.js",
          "src/assets/buttons.github.io/buttons.js",
          "src/assets/js/plugins/chartist.min.js",
          "src/assets/js/plugins/bootstrap-notify.js",
          "src/assets/js/material-dashboard.min40a0.js",
          "src/assets/demo/demo.js",
          "src/assets/demo/jquery.sharrre.js"
        ]

and the error i am getting is
Error

i am not able to generate production build .

I stuck too much time is there any possible solution ??

Source: Angular

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.