Created
May 13, 2016 00:09
-
-
Save anonymous/cdaa4b4f20a38f1f6924910db6f26b43 to your computer and use it in GitHub Desktop.
JS Bin GroupBy example using angular.filter // source http://jsbin.com/vucivacuqa
This file contains 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 characters
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<script src="https://code.jquery.com/jquery.min.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.4.7/angular-filter.js"></script> | |
<meta name="description" content="GroupBy example using angular.filter"/> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div ng-controller="MainController"> | |
<ul ng-repeat="(key, value) in players | groupBy: 'date'" class="list-group"> | |
<li class="list-group-item active"> | |
<h4>Group name: {{ key }}</h4> | |
</li> | |
<li ng-repeat="person in value" class="list-group-item"> | |
person: | |
{{ person.data.name }} <br> | |
{{ person.data.email }} | |
</li> | |
</ul> | |
</div> | |
<script id="jsbin-javascript"> | |
angular.module('app',['angular.filter']) | |
.controller('MainController', function($scope) { | |
$scope.players = [ | |
{ | |
date: "10-15-2016", | |
data : { | |
name : "Jayesh", | |
email: "jaycp@gmail.com" | |
} | |
}, | |
{ | |
date: "10-15-2016", | |
data : { | |
name : "Mona", | |
email: "mona.c@gmail.com" | |
} | |
}, | |
{ | |
date: "10-18-2016", | |
data : { | |
name : "Bobby", | |
email: "bobby.m@gmail.com" | |
} | |
} | |
]; | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<script src="https://code.jquery.com/jquery.min.js"><\/script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"><\/script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-filter/0.4.7/angular-filter.js"><\/script> | |
<meta name="description" content="GroupBy example using angular.filter"/> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div ng-controller="MainController"> | |
<ul ng-repeat="(key, value) in players | groupBy: 'date'" class="list-group"> | |
<li class="list-group-item active"> | |
<h4>Group name: {{ key }}</h4> | |
</li> | |
<li ng-repeat="person in value" class="list-group-item"> | |
person: | |
{{ person.data.name }} <br> | |
{{ person.data.email }} | |
</li> | |
</ul> | |
</div> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript">angular.module('app',['angular.filter']) | |
.controller('MainController', function($scope) { | |
$scope.players = [ | |
{ | |
date: "10-15-2016", | |
data : { | |
name : "Jayesh", | |
email: "jaycp@gmail.com" | |
} | |
}, | |
{ | |
date: "10-15-2016", | |
data : { | |
name : "Mona", | |
email: "mona.c@gmail.com" | |
} | |
}, | |
{ | |
date: "10-18-2016", | |
data : { | |
name : "Bobby", | |
email: "bobby.m@gmail.com" | |
} | |
} | |
]; | |
});</script></body> | |
</html> |
This file contains 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 characters
angular.module('app',['angular.filter']) | |
.controller('MainController', function($scope) { | |
$scope.players = [ | |
{ | |
date: "10-15-2016", | |
data : { | |
name : "Jayesh", | |
email: "jaycp@gmail.com" | |
} | |
}, | |
{ | |
date: "10-15-2016", | |
data : { | |
name : "Mona", | |
email: "mona.c@gmail.com" | |
} | |
}, | |
{ | |
date: "10-18-2016", | |
data : { | |
name : "Bobby", | |
email: "bobby.m@gmail.com" | |
} | |
} | |
]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment