datepicker is not a Function in typescript

Asked

Viewed 55 times

1

I want to implement datepicker in a typescript project.

I tried to use initially install datepicker by npm but could not....

Initially imported

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker.css">
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
    crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

Then in the construction of my initial class I initialized the variable of input data as a datepicker

this._inputData = $('#data').datetimepicker();

And then I get the message

NegociacaoController.js:6 Uncaught TypeError: $(...).datetimepicker is not a function
at new NegociacaoController (NegociacaoController.js:6)
at app.js:1
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.