Angularjs Loop Through Array In Javascript Code