angular-nanoscroller icon indicating copy to clipboard operation
angular-nanoscroller copied to clipboard

Check jqLite not working in angular#1.3.15

Open upmauro opened this issue 10 years ago • 1 comments

The function below not work for check if angular using jqLite ot jQuery in the last version of angular.

Maybe we need change to check if element have a exclusive jquery methods.

  //jQuery must be used, cause angular method 'find' has different behavior
  if (angular.element !== $) {
    throw new Error("Angular must use jQuery not jqLite");
  }

upmauro avatar Apr 17 '15 14:04 upmauro

+1 Angular 1.4.7 continues to throw this error.

A fix I found to work is replacing angular.element !== $ with: !angular.element.hasOwnProperty('fn')—giving you:

if (!angular.element.hasOwnProperty('fn')) {
    throw new Error("Angular must use jQuery not jqLite");
}

It successfully throws the error when jQuery is loaded after Angular, and jqLite is in use.

codiak avatar Nov 12 '15 03:11 codiak