<!DOCTYPE html>
<html>
<head>
<script data-require="angularjs@1.4.8" data-semver="1.4.8" src="https://code.angularjs.org/1.4.8/angular.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-app="example" ng-controller="ExampleCtrl as vm">
<h1>Waiting for...</h1>
<div ng-repeat="person in vm.peopleIWaitFor track by $index">{{ person }}</div>
</body>
</html>
angular.module('example', []);
angular.module('example')
.controller('ExampleCtrl', function( $interval, $timeout ) {
this.peopleIWaitFor = [];
$timeout(function() {
this.peopleIWaitFor.push('Superman');
}.bind(this), 1000);
var tracking = $interval(function() {
this.peopleIWaitFor.push('Godot');
}.bind(this), 100);
$timeout(function() {
$interval.cancel(tracking);
}.bind(this), 2000);
});