ng-repeat="obj in ctl.data | filter:fstr
| orderBy : '-price' | getRepeat"
※リストが表示されない場合
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; } th { color:#eee; background-color:#999; padding: 5px 10px;} td { color:#333; background-color:#ddd; padding: 5px 10px;} </style> </head> <body ng-app="myapp" ng-init="num=0"> <h1>データ表示</h1> <p>テキストを入力して下さい。</p> <div ng-controller="HeloController as ctl"> <div class="input"> <span class="label">検索:</span> <input type="text" ng-model="fstr"> </div> <p class="msg">{{ctl.getData()}}</p> <hr/> <table> <tr><th>ID</th><th>NAME</th><th>PRICE</th><th>GET?</th></tr> <tr ng-repeat="obj in ctl.data | filter:fstr | orderBy : '-price' | getRepeat"> <td>{{obj.id}}</td> <td>{{obj.name}}</td> <td>{{obj.price | currency:"¥"}}</td> <td>{{obj.get}}</td> </tr> </table> </div> </body> </html>
<< 前へ |