Angular Loop Over Array Javascript Push Pop