-
-
Save codecademydev/44eba388c44e9b2b8d3ae1f0f6b3b958 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module("GameboardApp", []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="col-sm-4"> | |
<div class="row scorecard"> | |
<p class="period">{{ info.period }}</p> | |
<div class="visitor col-xs-4"> | |
<h2 class="visitor-score">{{ info.visitor_score }}</h2> | |
<h3> | |
<span class="visitor-city">{{ info.visitor_team.city }}</span><br/> | |
<span class="visitor-name">{{ info.visitor_team.name }}</span> | |
</h3> | |
</div> | |
<div class="dash col-xs-3"> | |
<h2>-</h2> | |
</div> | |
<div class="home col-xs-4"> | |
<h2 class="home-score">{{ info.home_score }}</h2> | |
<h3> | |
<span class="home-city">{{ info.home_team.city }}</span><br/> | |
<span class="home-name">{{ info.home_team.name }}</span> | |
</h3> | |
</div> | |
</div> | |
</div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive('game', function() { | |
return { | |
restrict: 'E', | |
scope: { | |
info: '=' | |
}, | |
templateUrl: 'js/directives/game.html' | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300' rel='stylesheet' type='text/css'> | |
<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'> | |
<link href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet"> | |
<link href="css/main.css" rel="stylesheet"> | |
<script src="js/vendor/angular.min.js"></script> | |
</head> | |
<body ng-app="app"> | |
<div class="header"> | |
<h1 class="logo">GameBoard</h1> | |
</div> | |
<div class="main" ng-controller="ScoreController"> | |
<div class="container"> | |
<div class="row"> | |
<game info="score" ng-repeat="score in scores"></game> | |
</div> | |
</div> | |
</div> | |
<!-- Modules --> | |
<script src="js/app.js"></script> | |
<!-- Controllers --> | |
<script src="js/controllers/ScoreController.js"></script> | |
<!-- Directives --> | |
<script src="js/directives/game.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.controller('ScoreController', ['$scope', function($scope) { | |
$scope.scores = [ | |
{ | |
datetime: 1420848000000, | |
visitor_team: { | |
city: "Charlotte", | |
name: "Hornets" | |
}, | |
home_team: { | |
city: "New York", | |
name: "Knicks" | |
}, | |
period: "Final", | |
visitor_score: 110, | |
home_score: 82 | |
}, | |
{ | |
datetime: 1420848000000, | |
visitor_team: { | |
city: "Dallas", | |
name: "Mavericks" | |
}, | |
home_team: { | |
city: "Los Angeles", | |
name: "Clippers" | |
}, | |
period: "Final", | |
visitor_score: 100, | |
home_score: 120 | |
}, | |
{ | |
datetime: 1420848000000, | |
visitor_team: { | |
city: "Brooklyn", | |
name: "Nets" | |
}, | |
home_team: { | |
city: "Detroit", | |
name: "Pistons" | |
}, | |
period: "Third Quarter", | |
visitor_score: 69, | |
home_score: 74 | |
}, | |
{ | |
datetime: 1420848000000, | |
visitor_team: { | |
city: "Indiana", | |
name: "Pacers" | |
}, | |
home_team: { | |
city: "Philadelphia", | |
name: "76ers" | |
}, | |
period: "Third Quarter", | |
visitor_score: 70, | |
home_score: 72 | |
}, | |
{ | |
datetime: 1420848000000, | |
visitor_team: { | |
city: "San Antonio", | |
name: "Spurs" | |
}, | |
home_team: { | |
city: "Minnesota", | |
name: "Timberwolves" | |
}, | |
period: "Halftime", | |
visitor_score: 58, | |
home_score: 43 | |
}, | |
{ | |
datetime: 1420848000000, | |
visitor_team: { | |
city: "Orlando", | |
name: "Magic" | |
}, | |
home_team: { | |
city: "Portland", | |
name: "Trail Blazers" | |
}, | |
period: "First Quarter", | |
visitor_score: 13, | |
home_score: 26 | |
} | |
]; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment