-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(*): do not break when modules are used with angular-loader
#14794
Changes from all commits
d7dc3b6
2f0a4cc
0c7a232
f49b89d
6e89522
9a5c935
6f10fe1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
'use strict'; | ||
|
||
/* jshint ignore:start */ | ||
var noop = angular.noop; | ||
var copy = angular.copy; | ||
var extend = angular.extend; | ||
var jqLite = angular.element; | ||
var forEach = angular.forEach; | ||
var isArray = angular.isArray; | ||
var isString = angular.isString; | ||
var isObject = angular.isObject; | ||
var isUndefined = angular.isUndefined; | ||
var isDefined = angular.isDefined; | ||
var isFunction = angular.isFunction; | ||
var isElement = angular.isElement; | ||
|
||
var ELEMENT_NODE = 1; | ||
var COMMENT_NODE = 8; | ||
|
||
|
@@ -38,7 +24,7 @@ var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMA | |
// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit | ||
// therefore there is no reason to test anymore for other vendor prefixes: | ||
// http://caniuse.com/#search=transition | ||
if (isUndefined(window.ontransitionend) && isDefined(window.onwebkittransitionend)) { | ||
if ((window.ontransitionend === void 0) && (window.onwebkittransitionend !== void 0)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are initialized in the config phase. Here they are accessed before that. If we move the initialization of the constant inside a provider or config block, then we need to ensure that everything that depends on them doesn't run before they are available. I opted for the shortest viable fix 😄 |
||
CSS_PREFIX = '-webkit-'; | ||
TRANSITION_PROP = 'WebkitTransition'; | ||
TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend'; | ||
|
@@ -47,7 +33,7 @@ if (isUndefined(window.ontransitionend) && isDefined(window.onwebkittransitionen | |
TRANSITIONEND_EVENT = 'transitionend'; | ||
} | ||
|
||
if (isUndefined(window.onanimationend) && isDefined(window.onwebkitanimationend)) { | ||
if ((window.onanimationend === void 0) && (window.onwebkitanimationend !== void 0)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
CSS_PREFIX = '-webkit-'; | ||
ANIMATION_PROP = 'WebkitAnimation'; | ||
ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend'; | ||
|
@@ -69,10 +55,6 @@ var ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY; | |
var TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY; | ||
var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY; | ||
|
||
var isPromiseLike = function(p) { | ||
return p && p.then ? true : false; | ||
}; | ||
|
||
var ngMinErr = angular.$$minErr('ng'); | ||
function assertArg(arg, name, reason) { | ||
if (!arg) { | ||
|
@@ -128,7 +110,6 @@ function stripCommentsFromElement(element) { | |
switch (element.length) { | ||
case 0: | ||
return element; | ||
break; | ||
|
||
case 1: | ||
// there is no point of stripping anything if the element | ||
|
@@ -141,7 +122,6 @@ function stripCommentsFromElement(element) { | |
|
||
default: | ||
return jqLite(extractElementNode(element)); | ||
break; | ||
} | ||
} | ||
|
||
|
@@ -182,7 +162,7 @@ function applyAnimationClassesFactory($$jqLite) { | |
$$removeClass($$jqLite, element, options.removeClass); | ||
options.removeClass = null; | ||
} | ||
} | ||
}; | ||
} | ||
|
||
function prepareAnimationOptions(options) { | ||
|
@@ -318,7 +298,7 @@ function resolveElementClasses(existing, toAdd, toRemove) { | |
} | ||
|
||
function getDomNode(element) { | ||
return (element instanceof angular.element) ? element[0] : element; | ||
return (element instanceof jqLite) ? element[0] : element; | ||
} | ||
|
||
function applyGeneratedPreparationClasses(element, event, options) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../.jshintrc-base", | ||
"globals": { | ||
"window": false, | ||
|
||
"angular": false | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1