Skip to content

Instantly share code, notes, and snippets.

@comzeradd
Created October 29, 2016 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save comzeradd/fe00217b0821508b1cd892b55a276713 to your computer and use it in GitHub Desktop.
Save comzeradd/fe00217b0821508b1cd892b55a276713 to your computer and use it in GitHub Desktop.
render a json and filter out
<!DOCTYPE html>
<html lang="en" ng-app="mail">
<head>
<title>Mail Data</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div ng-view ng-controller="mailsCtrl">
<form role="search">
<input type="text" placeholder="type to filter" ng-model="search">
</form>
<div ng-repeat="mail in data | filter:search">
{{ mail }}
</div>
</div>
<script src="jquery.min.js"></script>
<script src="angular.min.js"></script>
<script>
var mail = angular.module('mail', []);
mail.controller('mailsCtrl', function ($scope, $http) {
$http.get('data.json').success(function(data) {
$scope.data = data;
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment