-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(ngUpgrade): Auto detect ngUpgrade apps and make the ng12Hybrid f… #3847
Conversation
} | ||
if (angular.getTestability) { | ||
angular.getTestability(el).whenStable(callback); | ||
} else if (window.angular.version == 2) { |
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.
Since Angular versions are going to keep advancing now, we should change this to:
else if (window.angular.version.major >= 2) {
throw new Error('You appear to be using angular, but window.getAngularTestability was ' +
'never set. This may be due to bad obfuscation.')
} else if (n < 1) { | ||
if (window.angular) { | ||
// Figure out which version of angular we're waiting on | ||
if(!definitelyNg1 && !definitelyNg2) { |
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.
nit: space after if
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.
Nice!
@@ -599,15 +603,36 @@ functions.testForAngular = function(attempts, ng12Hybrid, asyncCallback) { | |||
asyncCallback(args); | |||
}, 0); | |||
}; | |||
var definitelyNg1 = !!ng12Hybrid; | |||
var definitelyNg2 = 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.
We should probably rename this as well, given that angular version thing. What about just definitelyNg
callback({ver: 1}); | ||
} else if (n < 1) { | ||
if (window.angular) { | ||
// Figure out which version of angular we're waiting on |
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.
These comments should be /** */
style because some versions of webdriver will glomp lines together and //
comments break stuff.
} | ||
} else if (definitelyNg2) { | ||
if (true /** ng2 has no resumeBootstrap() **/) { | ||
return callback({ver: 2}); |
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.
Leaving this as ver: 2
is fine for now but we should make this more future-proof later.
…lag unnecessary for most users
@juliemr All comments addressed! |
LGTM |
…lag unnecessary for most users (angular#3847)
…lag unnecessary for most users
Closes #3836