diosney / angular-bootstrap-datetimepicker-directive

A wrapper directive around the bootstrap-datetimepicker component.
MIT License
69 stars 50 forks source link

JQLite bundled in Angular Conflicts #12

Closed cloidjgreen closed 9 years ago

cloidjgreen commented 9 years ago

If Angular.js is loaded on the page before jQuery then the call at line 36 of directive

            .on('dp.change', function (e) {
              if (ngModelCtrl) {
                $timeout(function () {
                  ngModelCtrl.$setViewValue(e.target.value);
                });
              }
            })
            .datetimepicker(options);

blows up with TypeError: $element.on(...).datepicker is not a function

Load order is:

     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.js"></script>

Switching load order to:

     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>

and everything works.

Mind numbingly difficult to find, at least for my mind.