Fixed IE8 + angular issue which causes a stack overflow. Fixes 2940