Programming Steps
Step-By-Step Programming For Beginners
Auto-Codes
C Language
Cobol 85 Language
ColdFusion Language
Cordova
HTML5
Java Language
Mobile
Objective-C Language
PhoneGap
PHP
Python Language
Ruby Language
Learn the powerful enterprise adaptable database:
Getting Started With ADABAS & Natural
Thursday, March 3, 2016
w3s118-AngularJS Filter OrderBy
w3s118-AngularJS Filter OrderBy
code example:
index.html
<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <body> <p>Click the table headers to change the sorting order:</p> <div ng-app="myApp" ng-controller="namesCtrl"> <table border="1" width="100%"> <tr> <th ng-click="orderByMe('name')">Name</th> <th ng-click="orderByMe('country')">Country</th> </tr> <tr ng-repeat="x in names | orderBy:myOrderBy"> <td>{{x.name}}</td> <td>{{x.country}}</td> </tr> </table> </div> <script> angular.module('myApp', []).controller('namesCtrl', function($scope) { $scope.names = [ {name:'Jani',country:'Norway'}, {name:'Carl',country:'Sweden'}, {name:'Margareth',country:'England'}, {name:'Hege',country:'Norway'}, {name:'Joe',country:'Denmark'}, {name:'Gustav',country:'Sweden'}, {name:'Birgit',country:'Denmark'}, {name:'Mary',country:'England'}, {name:'Kai',country:'Norway'} ]; $scope.orderByMe = function(x) { $scope.myOrderBy = x; } }); </script> </body> </html>
https://www.w3schools.com/angular/angular_filters.asp
201603
Related Posts:
What is Tilde in Programming?
TypeScript Online Editor
What is TypeScript?
Apps Script and JSON Web Token
102 Apps Script: ObjDb Sheet Regist...
Related Posts Widget
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment