Changed window.rAf to ionic.requestAnimationFrame