<body ng-app="myapp" ng-init="num = 1000">
<div ng-controller="HeloController as ctl">
<input type="text" ng-model="ctl.tax">%
<input type="text" ng-model="num">円
<p class="msg">税込: {{ctl.calcWithTax(num)}}円</p>
<p class="msg">税抜: {{ctl.calcWithoutTax(num)}}円</p>
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
<!doctype html> <html> <head> <title>AngularJS Sample</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script src="script.js"></script> <style> body { color:gray; } h1 { font-size:18pt; font-weight:bold; } span.label { display:inline-block;width:50px; color:red; } input { width:100px; } .msg { font-size:14pt; font-weight:bold;color:gray; } </style> </head> <body ng-app="myapp" ng-init="num = 1000"> <h1>税額計算</h1> <p>金額を入力して下さい。</p> <div ng-controller="HeloController as ctl"> <div class="input"> <span class="label">tax:</span> <input type="text" ng-model="ctl.tax">% </div> <div class="input"> <span class="label">price:</span> <input type="text" ng-model="num">円 </div> <p class="msg">税込: {{ctl.calcWithTax(num)}}円</p> <p class="msg">税抜: {{ctl.calcWithoutTax(num)}}円</p> </div> </body> </html>
<< 前へ | 次へ >> |