Skip to content
Permalink
Browse files

AngularJS

  • Loading branch information...
bretonics committed Jan 11, 2019
1 parent e15c562 commit f6e1e60f5c061b6b7fbf2b380eded92c04e48831
@@ -0,0 +1,64 @@
<!doctype html>
<html ng-app="cart">
<head>
<title>Book Shopping Cart</title>
<script src="js/angular157.js"></script>
<script src="js/cart.js"></script>
<link rel="stylesheet" href="css/cart.css">
</head>

<body ng-controller="CartControler">

<table>
<caption><b>My Books</b></caption>
<thead>
<tr>
<th>Title</th>
<th>Qty</th>
<th>UnitPrice</th>
<th>$UnitPrice</th>
<th>Line Total</th>
<th>Total {{total() | currency }} </th>
</tr>
</thead>
<tbody >
<tr ng-repeat="book in books track by $index">
<td>
<input ng-model="book.title">
</td>
<td>
<input ng-model="book.qty" size="2">
</td>
<td>
<input ng-model="book.price">
</td>
<td>{{book.price | currency}}</td>
<td>{{book.price * book.qty | currency}}</td>
<td align="center">
<button ng-click="removeBook($index)">
Remove
</button>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<th></th>
<th>
<button ng-click="newBook()">
New
</button>
</th>
<th></th>
<th></th>
<th>
<button ng-click="save()">
Save
</button>
</th>
<th></th>
</tr>
</tfoot>
</table>
</body>
</html>
@@ -0,0 +1,8 @@
table { border-collapse: collapse; font-family: Futura, Arial, sans-serif; }
caption { font-size: larger; }
th, td { padding: .5em; }
th, thead, tfoot { background: #000; color: #fff; border: 1px solid #000; }
tr { background: #ccc; }
tr:hover { background: #def; }
td { border-right: 1px solid #777; }
table { border: 2px solid #777; }
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en" ng-app="Filter">
<head>
<meta charset="utf-8">
<title>Filter Token</title>
<script src="js/angular157.js"></script>
<script src="js/filter.js"></script>
</head>
<body>
<div ng-controller="FilterController">
<p> Input: <input ng-model="input"> </p>
<p> Delimiter: <input ng-model="delim"> </p>
<p>{{ input | tokenize }} (Default)</p>
<p>{{ input | tokenize:delim }} (With option)</p>
</div>
</body>
</html>
Oops, something went wrong.

0 comments on commit f6e1e60

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.