Skip to content

Instantly share code, notes, and snippets.

@thaenor
Created January 22, 2015 13:49
Show Gist options
  • Save thaenor/45a0523ae9b10dd7587d to your computer and use it in GitHub Desktop.
Save thaenor/45a0523ae9b10dd7587d to your computer and use it in GitHub Desktop.
Angular binding, calculates stuff
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div data-ng-app="" data-ng-init="quantity=1;price=5">
<h2>Cost Calculator</h2>
Quantity: <input type="number" ng-model="quantity">
Price: <input type="number" ng-model="price">
<p><b>Total in dollar:</b> {{quantity * price}}</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment