Skip to content

Instantly share code, notes, and snippets.

@marsyang1
Created June 4, 2015 01:39
Show Gist options
  • Save marsyang1/1ba03bfc206683792331 to your computer and use it in GitHub Desktop.
Save marsyang1/1ba03bfc206683792331 to your computer and use it in GitHub Desktop.
AngularJS Test
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
<title>AngularJS test</title>
</head>
<body>
AngularJS basic
<br/>
{{ 9999 }}
<br>
{{ 9999+1 }}
<br>
{{ 9*9 }}
<br>
{{ 'Hello World' }}
<hr/>
AngularJS Filter
<br/>
{{ 9999 | number }}
<br>
{{ 9999+1 | number:2 }}
<br>
{{ 9*9 | currency }}
<br>
{{ 'Hello World' | uppercase }}
<hr/>
AngularJS two-way bind <br/>
數量: <input type="number" ng-model="quantity" ng-init="quantity = 1">
<br>
單價: <input type="number" ng-model="price" ng-init="price = 299">
<br>
總價: {{ quantity * price }}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment