JSFiddle - React, Tailwind, and code Playground
by Shanid
HTML
<div ng-app="myApp">
<div ng-controller="mainController">
<input type="text" ng-model="search">
{{(data | filter: search).length}}
<ul ng-repeat="d in data | filter: search | filter:testFilter | orderBy:'age'" >
<li>{{d.name | uppercase}}</li>
<li>{{d.age}}</li>
</ul>
<pre>{{data|json}}</pre>
</div>
</div>
JavaScript
var app = angular.module('myApp',[]);
app.controller('mainController',['$scope', 'myFactory', function($scope,myFactory){
function initialize(){
$scope.data = [
{
'name': 'shanid',
'age':20
},
{
'name': 'Raj',
'age':30
},
{
'name': 'Raj',
'age':10
},
{
'name': 'Raj',
'age':140
}
];
console.log('ResData', $scope.ResData);
}
initialize()
}]);
app.factory('myFactory',['$http','$scope', function($http,$scope){
return{
$http.get('httpshttps://api.github.com/users/peterbe/gists')
.success(function(data) {
$scope.ResData = data;
}
}
}]);