One possible solution.

I've deployed the app to https://morning-chamber-2168.herokuapp.com/.

The infinite scrolling became a jQuery plugin, although the inner code does not depend on jQuery:
https://github.com/apfelfabrik/code-tests/blob/master/app/scripts/infiniScroll.js
https://github.com/apfelfabrik/code-tests/blob/master/app/scripts/main.js#L18-L30