Callback on ng-repeat end
Shows a simple directive that can be used to call a method when ng-repeat ends
by 100thGear
HTML
<script src="http://code.angularjs.org/1.2.0-rc.3/angular.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script src="http://code.angularjs.org/1.2.0-rc.3/angular-route.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<div ng-controller="MyCtrl" class="well">
<div ng-repeat="question in names.questions" repeat-end="onEnd()">
<h3>
{{question.text}}
</h3>
<div ng-repeat="choice in question.choices">
<h5>
{{choice.text}}
</h5>
</div>
</div>
</div>
JavaScript
(function () {
angular.element(document).ready(function () {
var app = angular.module('myApp', []);
app.controller("MyCtrl", function($scope, $timeout){
$scope.names = {"questions": [{
"id": 4,
"rowId": 1,
"type": "radio",
"text": "Legal Entity Type:",
"response": 7,
"responseData": "[[1001,1005,\"233\",null,\"89\"],[\"\",1003],[\"\",\"\"]]",
"choices": [{
"id": 7,
"text": "blah",
"value": null,
"html": null
},
{
"id": 8,
"text": "The information provided above is based on a reasonable estimate.",
"value": null,
"html": null
},
{
"id": 9,
"text": "The information provided above is pulled directly from a system. Please enter the name of the system used to obtain data: ",
"value": null,
"html": null
}]
},
{
"id": 5,
"rowId": 1,
"type": "radio",
"text": "Industry Type:",
"response": 10,
"responseData": "[[1003,1003,\"5\",null,\"4\"],[1002,1005,\"6\",null,\"8\"],[\"\",\"\"]]",
"choices": [{
"id": 10,
"text": "crap",
"value": null,
"html": null
},
{
"id": 11,
"text": "The information provided above is based on a reasonable estimate.",
"value": null,
"html": null
},
{
"id": 12,
"text": "The information provided above is pulled directly from a system. Please enter the name of the system used to obtain data: ",
"value": null,
"html": null
}]
},
{
"id": 6,
"rowId": 2,
"type": "radio",
"text": "Product:",
"response": 0,
"responseData": null,
"choices": [{
"id": 13,
"text": "junk",
"value": null,
"html": null
},
{
"id": 14,
"text": "The information provided above is based on a reasonable estimate.",
"value": null,
"html": null
},
{
"id": 15,
"text": "The information provided above is pulled directly...