Created
September 23, 2013 07:48
-
-
Save kohgpat/6667582 to your computer and use it in GitHub Desktop.
Revisions
-
kohgpat created this gist
Sep 23, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ angular.module("app.users", ["ngResource"]).factory("Users", function($resource) { return $resource("users.json", {}, {get: {method: "GET", isArray: true}}); }); angular.module("app.filters", []).filter("date", function() { moment.lang("ru"); return function(date) { return moment(new Date(date)).format("L"); }; }); angular.module("app", ["app.users", "app.filters"]); function UsersCtrl($scope, Users) { $scope.users = Users.get(); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ <!doctype html> <html lang="en" ng-app="app"> <head> <title>Date Filters</title> <meta chartset="utf-8"> <script type="text/javascript" src="src/js/moment+langs.min.js"></script> <script type="text/javascript" src="src/js/angular.min.js"></script> <script type="text/javascript" src="src/js/angular-resource.min.js"></script> <script type="text/javascript" src="src/js/app.js"></script> </head> <body> <div id="container" ng-controller="UsersCtrl"> <h1>Users</h1> <div id="filter"> <input type="text" ng-model="userFilter.firstName" placeholder="First Name" /> <input type="text" ng-model="userFilter.lastName" placeholder="Last Name" /> <input type="text" ng-model="userFilter.email" placeholder="Email" /> <input type="text" ng-model="userFilter.createdAt" placeholder="Created" /> </div> <table class="table"> <thead> <tr> <th>First Name</th> <th>Last Name</th> <th>Email</th> <th>Created at</th> </tr> </thead> <tbody> <tr ng-repeat="user in users | filter: userFilter"> <td>{{user.firstName}}</td> <td>{{user.lastName}}</td> <td>{{user.email}}</td> <td>{{user.createdAt | date}}</td> </tr> </tbody> </table> </div> </body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ [ { "firstName": "John", "lastName": "Doe", "email": "[email protected]", "createdAt": "2010-10-13" }, { "firstName": "Alice", "lastName": "Appleseed", "email": "[email protected]", "createdAt": "2011-12-12" } ]