Skip to content

Instantly share code, notes, and snippets.

@murphysean
Created August 27, 2014 04:07
Show Gist options
  • Save murphysean/0f3a1195059d505ec4d4 to your computer and use it in GitHub Desktop.
Save murphysean/0f3a1195059d505ec4d4 to your computer and use it in GitHub Desktop.
HTML5 Cow Game Exercise
<!DOCTYPE HTML>
<html ng-app="cowgame">
<head>
<meta charset="UTF-8">
<title>Cow Game</title>
<style>
/*TODO Add style here for the image tag in the app below, get it centered up in the page*/
/*TODO Also style up the score to be centered, and some cool color*/
</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.19/angular.min.js"></script>
</head>
<body>
<section>
<article ng-controller="CowController">
<!--TODO Find a cow image on the internet, slip it in here-->
<img src="" ng-click="onClick()"/>
<p>{{score}}</p>
</article>
</section>
<script>
angular.module('cowgame',[]).controller('CowController',['$scope',function CowController($scope){
$scope.score = 0;
$scope.onClick = function onClick(){
//TODO Update the score here
};
}]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment