Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

refactor(): delete a usless conditional sentence #14282

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/ngAnimate/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,6 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
// may attempt more elements, but custom drivers are more particular
for (var i = drivers.length - 1; i >= 0; i--) {
var driverName = drivers[i];
if (!$injector.has(driverName)) continue; // TODO(matsko): remove this check

var factory = $injector.get(driverName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matsko, any idea why you had marked this for removal ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this was only here for debugging. If the driverName refers to a driver that has not be registered with the injector then that is surely an error.

We register only two drivers in the ngAnimate module:

  • $$animateCssDriver
  • $$animateJsDriver

We do this from inside their respective providers, so it is not possible for our code to break this.

var driver = factory(animationDetails);
if (driver) {
Expand Down