Issue
I have an array of objects ObjectsArr= [Object1 , Object2,Object3, Object4]
I want to show in my view the last object, how to do that in angularjs?
Solution
ObjectsArr[ObjectsArr.length - 1]
-- this will give you the last element in the array.
To display it in view:
{{ObjectsArr[ObjectsArr.length - 1]}}
This will work even when the array has zero entries.
Answered By - Vinay K
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.