Skip to content

Instantly share code, notes, and snippets.

@corydodt
Last active January 2, 2016 13:18
Show Gist options
  • Save corydodt/8308739 to your computer and use it in GitHub Desktop.
Save corydodt/8308739 to your computer and use it in GitHub Desktop.
pizza code
"use strict";
var pizzaApp = angular.module("pizzaApp", []);
pizzaApp.controller('PizzaCtrl', function _a_PizzaCtrl($scope) {
$scope.ingredients = ['pepperoni', 'sausage', 'anchovies', 'olives', 'onions'];
$scope.addIngredient = function _a_addIngredient() {
if ($scope.form.newIngredient.length > 0) {
$scope.ingredients.push($scope.form.newIngredient);
$scope.form.newIngredient = '';
}
};
$scope.form = {newIngredient: ''};
});
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>Welcome to Pizza Cart!</title>
<style type='text/css'>
body, html { width: 100%; }
body { margin: 30px;
padding: 0px;
border: 0px;
font-family: georgia,serif;
}
h1, h2, h3 {
margin: 0px 0px 8px -30px;
border-left: 30px solid #669;
color: white;
background-color: #669;
font-family: verdana,sans-serif;
}
</style>
<script src=
"http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.js"></script>
<script src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src=
"http://rawgithub.com/corydodt/8308739/raw/gistfile1.js"></script>
</head>
<body ng-app="pizzaApp">
<main ng-controller="PizzaCtrl">
<img style="height: 100px" src="http://richthediabetic.com/wp-content/uploads/2013/07/Pizza.jpg">
<img style="height: 100px" src="http://i.c-b.co/is/image/Crate/LibationsBarCart3QF12">
<h1>Welcome to Pizza Cart administrator!</h1>
<h3>Modify ingredients list</h3>
<h4>These ingredients will be available on the menu.</h4>
<ul>
<li ng-repeat="ing in ingredients">{{ ing }}</li>
</ul>
<form>
<input type="text" placeholder="Add ingredient" ng-model="form.newIngredient" />
<input type="submit" ng-click="addIngredient()" />
</form>
</main>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment