Angularjs Loop Through Array Javascript Length Function