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)

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

3.Order By

 <div ng-controller="TestCtrl">
{{ data | orderBy: 'age' }} <br />
{{ data | orderBy: '-age' }} <br />
{{ data | orderBy: '-age' | limitTo: 2 }} <br />
{{ data | orderBy: ['-age', 'name'] }} <br />
</div> <script type="text/javascript">
var TestCtrl = function($scope){
$scope.data = [
{name: 'B', age: 4},
{name: 'A', age: 1},
{name: 'D', age: 3},
{name: 'C', age: 3},
];
} angular.bootstrap(document.documentElement);
</script>
上一篇:安装jhipster


下一篇:C语言_scanf()和getchar() 使用[粗俗易懂]