 <p>If the possible duplicate doesn't fulfil your needs here's a way to do it - <a href="http://plnkr.co/edit/E7vYgBPwd1sBeObEl2vd?p=preview" rel="nofollow">Plunker</a>.</p> <p>JS</p> <pre><code>app = angular.module("app", []); app.directive("test", [ function() { return { restrict: "E", template: "&lt;div ng-repeat='item in ts.items track by $index' ng-init='ts.blah($index, $last)'&gt;{{$index}}&lt;/div&gt;", scope: {}, controllerAs: "ts", bindToController: true, controller:function() { var ts = this; ts.items = [0, 1, 2, 3, 4]; ts.blah = function(index, last) { console.log(index, last); if (last) { // Do your stuff } } } } }]); </code></pre> <p>Markup</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="style.css"&gt; &lt;script src="script.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body ng-app="app"&gt; &lt;test&gt;&lt;/test&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The output from the console is:</p> <blockquote> <p>0 false <br> 1 false <br> 2 false <br> 3 false <br> 4 true</p> </blockquote> <p>so you should (in theory) be able to rely on the last repeat element being created last.</p>