Wednesday, April 16, 2014

AngularJs with IPhone 3GS bug

I just killed annoying IPhone 3GS bug inside my angular app.

The symptom is when I hit "back" button, it doesn't want to go back.
I thought it was rendering bug in the old phone.
Luckily after spending couple hours debugging, it end up with problem inside "onDestroy" event of couple my directives.

It doesn't support element.remove(). which "remove" is undefined.
So I just need to use angular.element(element).remove() which fix the problem.

In summary, when your page doesn't render on back button or next button, make sure you check all onDestroy event on your particular page.