initial commit

This commit is contained in:
Tyrel Souza 2014-05-15 21:19:12 -04:00
commit 3b1ea6c538
6 changed files with 114 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
bower_components/
.idea/

9
bower.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "application-name",
"version": "0.0.1",
"main": "stylesheets/main.css",
"dependencies": {
"angular": "latest",
"jquery": "latest"
}
}

16
data/playgrounds.json Normal file
View File

@ -0,0 +1,16 @@
[{
"name": "Portsmouth Street Playground",
"size": "2.9"
},{
"name": "Main Street Playground",
"size": "0.4"
},{
"name": "Boston Common Frog Pond",
"size": "0.8"
},{
"name": "The Esplanade",
"size": "10.4"
},
{
"name": "SHOULD NOT SHOW"
}]

37
index.html Normal file
View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html ng-app="playground">
<head>
<title>HTML5 template</title>
<meta charset="utf-8" />
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/jquery/dist/jquery.js"></script>
<link rel="stylesheet" href="stylesheets/main.css" />
</head>
<body ng-controller="PlaygroundController as pground">
<header>
<h1>A Blank HTML5 template</h1>
<menu>
<ul>
<li>
<a href="#">Home</a>
</li>
</ul>
</menu>
</header>
<content>
<ul>
<li ng-repeat="playground in pground.playgrounds">
<p ng-show="playground.size > 0">
<strong>{{playground.name}}</strong>
<p ng-show="playground.size">{{playground.size}} acres</p>
</p>
</li>
</ul>
</content>
<script type="text/javascript" src="javascript/main.js"></script>
</body>
</html>

29
javascript/main.js Normal file
View File

@ -0,0 +1,29 @@
/**
* Created by tsouza on 5/15/14.
*/
(function(){
var app = angular.module("playground", []);
app.controller("PlaygroundController", function($scope, playgroundService){
var self = this;
this.playgrounds = {};
playgroundService.getPlaygrounds()
.then(function(playgrounds){
self.playgrounds = playgrounds;
});
});
var playgroundService = app.factory("playgroundService", function($http) {
return {
getPlaygrounds: function () {
return $http.get("data/playgrounds.json")
.then(function (result) {
return result.data;
});
}
}
});
})();

21
stylesheets/main.css Normal file
View File

@ -0,0 +1,21 @@
* {
margin: 0;
padding: 0;
}
header, menu, content, footer {
display: block;
}
menu ul {
list-style-type: none;
}
menu ul li {
float: left;
padding: 5px 20px;
}
content, footer {
clear: both;
}