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 id="place-order" class="row"> | |
<h2>Check out now</h2> | |
<p>Please enter your details, and we'll ship your goods right away!</p> | |
<form name="shippingForm" novalidate> | |
<h3>Ship to</h3> | |
<div class="form-group"> | |
<label>Name</label> | |
<input class="form-control" ng-model="data.shipping.name" required /> | |
<span class="error" ng-show="shippingForm.name.$error.required"> | |
Please enter a name |
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 id="place-order" class="row"> | |
<h2>Check out now</h2> | |
<p>Please enter your details, and we'll ship your goods right away!</p> | |
<form name="shippingForm" novalidate> | |
<h3>Ship to</h3> | |
<div class="form-group"> | |
<label>Name</label> | |
<input class="form-control" ng-model="data.shipping.name" required /> | |
</div> | |
<h3>Address</h3> |
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
html, | |
body, | |
ul, | |
li { | |
margin: 0; padding: 0; | |
} | |
body { | |
font: normal 16px/24px "Helvetica Neue", Helvetica, Arial, freesans, sans-serif; background: #c1c1c1; | |
} |
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 ng-app="store"> | |
<head> | |
<title>Store</title> | |
<script src="./static/js/angular.js"></script> | |
<script src="./static/js/store.js"></script> | |
<script src="./static/js/controllers/store.js"></script> | |
<script src="./static/js/controllers/productListControllers.js"></script> | |
<script src="./static/js/filters/customFilters.js"></script> |
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
angular | |
.module('cart', []); | |
.factory('cart', function () { | |
var cartData = {}; | |
return { | |
addProduct: function (id, name, price) { | |
var addToExistingItem = false; | |
for (var i = 0; i < cartData.length; i++) { |
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
angular | |
.module('cart', []); | |
.factory('cart', function () { | |
var cartData = {}; | |
return { | |
addProduct: function (id, name, price) { | |
var addToExistingItem = false; | |
for (var i = 0; i < cartData.length; i++) { |
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 ng-app="store"> | |
<head> | |
<title>Store</title> | |
<script src="./static/js/angular.js"></script> | |
<script src="./static/js/store.js"></script> | |
<script src="./static/js/controllers/store.js"></script> | |
<script src="./static/js/controllers/productListControllers.js"></script> | |
<script src="./static/js/filters/customFilters.js"></script> |
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 ng-app="store"> | |
<head> | |
<title>Store</title> | |
<script src="./static/js/angular.js"></script> | |
<script src="./static/js/store.js"></script> | |
<script src="./static/js/controllers/store.js"></script> | |
<script src="./static/js/controllers/productListControllers.js"></script> | |
<script src="./static/js/filters/customFilters.js"></script> |
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
angular | |
.module('customFilters', []) | |
.filter('unique', function () { | |
return function (data, propertyName) { | |
if (angular.isArray(data) && angular.isString(propertyName)) { | |
var results = []; | |
var keys = {}; | |
for (var i = 0; i < data.length; i++) { | |
var val = data[i][propertyName]; | |
if (angular.isUndefined(keys[val])) { |
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
angular | |
.module('store') | |
.constant('productListActiveClass', 'active') | |
.controller('productListController', function ($scope, $filter, productListActiveClass) { | |
var selectedCategory = null; | |
$scope.selectCategory = function (categoryName) { | |
selectedCategory = categoryName; | |
}; |