0

I am trying to use Tempus Dominus with Bootstrap 4 and AngularJS.

GitHub Docs/Usage

Sadly, I can't get it to work, I get an error.

I have the following code:

var picker = $('#datetimepicker1'); // I tried this
var picker = angular.element( document.querySelector( '#datetimepicker1' ) ); // And this
picker.datetimepicker();

I get the following error:

Uncaught TypeError: picker.datetimepicker is not a function
    at HTMLDocument.<anonymous> (eventDetailController.js:15)
    at j (jquery.min.js:2)
    at k (jquery.min.js:2)

Require

I am using RequireJS and this is my shim loader part for datetimepicker:

'datetimepicker': {
        deps: ['jquery', 'moment-wrapper', 'moment']
 }

More Information

I am using NPM and Bower (no Webpack).

  • Bootstrap: v4.0.0-alpha.6
  • jQuery: latest
VincenzoC
  • 30,117
  • 12
  • 90
  • 112
El Mac
  • 3,256
  • 7
  • 38
  • 58
  • I would start from the config. How did you install the Bootstrap? Do you use webpack? – proti Sep 19 '17 at 19:23
  • @proti I have added some informations that you could find useful – El Mac Sep 19 '17 at 19:33
  • OK, Cool. But how you require Bootstrap to the project? Are you able to use any Bootstrap and jQuery components or classes? look here maybe it will help you: https://stackoverflow.com/questions/8678254/datetimepicker-is-not-a-function-jquery – proti Sep 20 '17 at 14:25
  • @proti yes, Bootstrap and jQuery are working correctly. I have solved the problem with an other datepicker now. – El Mac Sep 22 '17 at 10:28

0 Answers0