AngularJS 乱记

1. 前端简单逻辑

<title data-ng-bind="{true:' ('+notice_count+') '}[notice_count > 0]+{true:global.title,false:'正在加载中'}[global.loading_done]+' - xxxx'"></title>

2.qx-radio button(bootstrap)

1 <div class="col-xs-12 col-sm-12 col-md-12 col-lg-11" data-toggle="buttons">
2 <label class="btn btn-link btn-sm {{$index==0&&'active'}}" qx-radio="" ng-model="query[item.query_key]"
3 ng-repeat="enum in filter.data[item.key] | orderBy:['value']" ng-click="search();">
4 <input type="radio" name="item.key" value="{{enum.value}}" class="toggle" />
5 {{enum.name}}
6 </label>
7 </div>

 

3.Order By

 1 <div ng-controller="TestCtrl">
 2     {{ data | orderBy: 'age' }} <br />
 3     {{ data | orderBy: '-age' }} <br />
 4     {{ data | orderBy: '-age' | limitTo: 2 }} <br />
 5     {{ data | orderBy: ['-age', 'name'] }} <br />
 6   </div>
 7   
 8   
 9   <script type="text/javascript">
10   var TestCtrl = function($scope){
11     $scope.data = [
12       {name: 'B', age: 4},  
13       {name: 'A', age: 1},  
14       {name: 'D', age: 3},  
15       {name: 'C', age: 3},  
16     ];
17   }
18   
19   angular.bootstrap(document.documentElement);
20   </script>

 

posted @ 2014-09-17 10:04  流失的痕迹  阅读(182)  评论(0编辑  收藏  举报