Angular Create Json Array Javascript Length Method