Update ng-infinite-scroll.js

Change $window and elem, into JQuery elements because within the handler() function you are referencing them with JQuery functions. AngularJs Elements does not have heigth(), offset().top functionality.

If they are not reference, you will get a TypeOffError undefined for the following.