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 #11

Open cloidjgreen opened 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

 $element
     .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.

davisg123 commented 8 years ago

Wow, super annoying and gave me a huge headache as well. Closing my #22 as duplicate