Today, We want to share with you Angularjs Get first and last value of list-item (li).In this post we will show you Angular ngFor, ng-template and the compiler, hear for Add a class to last 3 list items in AngularJS we will give you demo and example for implement.In this post, we will learn about Show only first and last child as result inside `ng-repeat` with an example.
Angularjs Get first and last value of list-item (li)
There are the Following The simple About angularjs show last 5 items in ng-repeat list Full Information With Example and source code.
As I will cover this Post with live Working example to develop how to get last value of array in angularjs, so the Angular NgFor: Everything you need to know is used for this example is following below.
How to get the last record in an array in AngularJS?
{{ObjectsArr[ObjectsArr.length - 1]}}
var app = angular.module('app', ['ui.bootstrap']); app.controller('productCtrl', function ($scope) { $scope.data = [1,2,3] });
Example
- {{item}}