CHanged native foreach to angular foreach to support ie