Created
January 22, 2015 13:49
-
-
Save thaenor/45a0523ae9b10dd7587d to your computer and use it in GitHub Desktop.
Angular binding, calculates stuff
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> | |
<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