<!DOCTYPE html>
<html>
<head>
<script data-require="angular.js@1.2.0-rc3-nonmin"
data-semver="1.2.0-rc3-nonmin"
src="http://code.angularjs.org/1.2.0-rc.3/angular.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<h1>Random Number: {{random}}!</h1>
</body>
</html>
angular.module("myApp", [])
.controller("myCtrl", function($scope, $q) {
var deferred = $q.defer();
setTimeout(function() {
$scope.$apply(function() {
deferred.resolve(Math.random());
});
}, 1000);
$scope.random = deferred.promise;
});
/* Styles go here */