angular parallax - jquery to angular

The reason what you have does not work is because angular.element does not work via jQuery selectors, it only works via tag names. documentation

In order to get what you have to work you would have to change

angular.element('.parallax-background')

to:

angular.element(document.getElementsByClassName('.parallax-background')[0])

Suggested/Recommended Solution:

That being said, you should really consider doing this via a directive rather than in the controller as it is the appropriate place to put DOM manipulation.

Tags:

Angularjs