I have a template in which I want to generate some HTML only if the current item has some different fields from the previous item. How can I access the previous item in an
One way is to use the $index for targeting previous item:
HTML:
{{$index}}:
JS:
app.controller('AppController', [ '$scope', function($scope) { $scope.items = [ {name: 'Misko'}, {name: 'Igor'}, {name: 'Vojta'} ]; } ] );
Plunker