fix($animate): properly handle class resolution when element data is missing

Closes #9636