Skip to content

Instantly share code, notes, and snippets.

@localdevm
Created October 3, 2016 14:34
Show Gist options
  • Save localdevm/d1691a19aa4dc5bb46ff8de56d5f4c78 to your computer and use it in GitHub Desktop.
Save localdevm/d1691a19aa4dc5bb46ff8de56d5f4c78 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Sample</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js"></script>
<script>
angular.module('sampleApp', []);
angular.module('sampleApp').controller('FirstController', function ($scope, $interval) {
$scope.first = {
greeting: "Hallo"
};
var time = 0;
$interval(function(){
console.log("And jump");
time++;
if (time == 3){
console.log("testje");
}
}, 1000);
});
angular.module('sampleApp').controller('SecondController', function ($scope){
$scope.first.greeting = "HalloNowNested";
});
</script>
</head>
<body ng-app="sampleApp">
<div ng-controller="FirstController">
<h1>{{ first.greeting}}</h1>
<img src="workout1.png">
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment