angular-nanoscroller
angular-nanoscroller copied to clipboard
Check jqLite not working in angular#1.3.15
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");
}
+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.