Skip to content

Instantly share code, notes, and snippets.

@in-async
Created March 10, 2015 07:39
Show Gist options
  • Save in-async/8142d40e1727ca99a66d to your computer and use it in GitHub Desktop.
Save in-async/8142d40e1727ca99a66d to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JS Bin</title>
<style>
body {
margin: 0;
font-size: 30px;
line-height: 1.25;
}
#content {
padding: .5em;
background-color: #eee;
height: 600px;
}
</style>
</head>
<body ng-app='myApp'>
<div id="content" ng-controller='fooCtrl'>
{{foo}}
{{count}}
</div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script>
// ngTouch モジュールに依存
angular.module('myApp', [])
.controller('fooCtrl', ['$scope', '$interval', function($scope, $interval) {
$scope.foo = 'foo by app';
$scope.count = 0;
$interval(function() {
$scope.count++;
}, 100, 100);
}]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment