最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Angular實(shí)現(xiàn)的內(nèi)置過濾器orderBy排序與模糊查詢功能示例

 更新時(shí)間:2017年12月29日 12:11:16   作者:當(dāng)愛0201  
這篇文章主要介紹了Angular實(shí)現(xiàn)的內(nèi)置過濾器orderBy排序與模糊查詢功能,涉及AngularJS過濾器、排序及字符串遍歷、查詢等相關(guān)操作技巧,需要的朋友可以參考下

本文實(shí)例講述了Angular實(shí)現(xiàn)的內(nèi)置過濾器orderBy排序與模糊查詢功能。分享給大家供大家參考,具體如下:

先來看看運(yùn)行效果:

具體代碼如下:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>www.fzitv.net Angular模糊查詢、排序</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    table{
      margin: 100px auto;
      border-collapse: collapse;
    }
    th,td{
      padding: 10px;
      border: 1px solid #000;
    }
  </style>
  <script src="angular.min.js"></script>
  <script>
    var myapp=angular.module("myapp",[]);
    myapp.controller("myCtrl",function ($scope) {
      $scope.books=[{
        name:"JavaScript",public:false,update:"1504707661308",has:true
      },{
        name:"Angular權(quán)威教程",public:false,update:"1204707661308",has:false
      },{
        name:"Vue實(shí)戰(zhàn)",public:false,update:"1804707661308",has:false
      },{
        name:"JavaScript",public:true,update:"1504707561308",has:true
      }];
      $scope.price="99.9";
      /*$scope.filt=""*/
    })
  </script>
</head>
<body ng-app="myapp" ng-controller="myCtrl">
<input type="text" ng-model="filt">
<table>
  <thead><tr>
    <th>名字</th>
    <th>出版情況</th>
    <th>更新時(shí)間</th>
    <th>是否有庫(kù)存</th>
  </tr></thead>
  <tbody>
  <!--|limitTo:2顯示兩條數(shù)據(jù)-->
  <tr ng-repeat="item in books | filter:filt |orderBy:'-name':false">
    <td>{{item.name|lowercase}}</td>
    <td>{{item.public}}</td>
    <td>{{item.update |date:'yyyy年MM月dd日 hh:mm:ss EEE'}}</td>
    <td>{{item.has}}</td>
  </tr>
  </tbody>
</table>
<div>{{price|currency:"¥"}}</div>
</body>
</html>

更多關(guān)于AngularJS相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《AngularJS指令操作技巧總結(jié)》、《AngularJS入門與進(jìn)階教程》及《AngularJS MVC架構(gòu)總結(jié)

希望本文所述對(duì)大家AngularJS程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

永和县| 青川县| 湖州市| 田阳县| 珲春市| 明水县| 东兴市| 定州市| 曲周县| 松原市| 凤台县| 忻城县| 南郑县| 阜康市| 岑巩县| 栖霞市| 新龙县| 西吉县| 仙桃市| 永德县| 阿图什市| 天津市| 时尚| 河北省| 高邑县| 印江| 台安县| 阳泉市| 修文县| 忻州市| 盈江县| 奉贤区| 安岳县| 馆陶县| 车险| 武平县| 合作市| 江山市| 平塘县| 孟州市| 明水县|