企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` <!DOCTYPE html> <html lang="zh-CN" ng-app="myApp"> <head> <title>Simple app</title> <meta charset="UTF-8"> <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet"> <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.css" rel="stylesheet"> <script src="http://cdn.bootcss.com/angular.js/1.4.9/angular.js"></script> <script src="http://cdn.bootcss.com/jquery/2.2.1/jquery.js"></script> </head> <body> <div class="container"> <div class="panel panel-default"> <div class="panel-heading">Angular.js</div> <div class="panel-body"> <form class="form-horizontal" ng-controller="MyCtrl"> 排序 <select name="orderby" ng-model="orderby"> <option value="age">age</option> <option value="name">name</option> </select> <ul> <li ng-repeat="user in users | filter:{sex:1} | orderBy : orderby">{{user}}</li> </ul> </form> </div> </div> </div> <script type="text/javascript"> angular.module('myApp', []) .controller('MyCtrl', function($scope){ $scope.users = [ { name : 'b20', age : 20, sex : 1 }, { name : 'd17', age : 17, sex : 0 }, { name : 'a18', age : 18, sex : 0 }, { name : 'c19', age : 19, sex : 1 }, ]; $scope.orderby = 'age'; }); </script> </body> </html> ```