Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2013 12:44
Show Gist options
  • Save anonymous/7958749 to your computer and use it in GitHub Desktop.
Save anonymous/7958749 to your computer and use it in GitHub Desktop.
A Pen by mehmetcanker.
<html ng-app="mehmetCanker">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js"></script>
</script>
</head>
<body>
<div ng-controller="repeatCtrl">
<h1 ng-bind="title"></h1>
<!--if you want search in all data use searching.$ -->
<input type="text" placeholder="search All Data" ng-model="searching.$" /> OR
<!-- Searching by Name -->
<input type="text" placeholder="search by Name" ng-model="searching.name" /> OR
<!-- Searching by Age -->
<input type="text" placeholder="search by Age" ng-model="searching.age" />
<ul>
<li ng-repeat="cat in cats | filter:searching">{{cat.name +" - " + cat.age+ " - "+ cat.gender}}</li>
</ul>
</div>
</body>
</html>
//More info htpp://mehmetcanker.com
//Module Defining
//Module Tanimlaniyor.
var myApp = angular.module('mehmetCanker', []);
//Creating Controller in mehmetCanker module
//Olusturulan module icine controller //tanimladik
myApp.controller('repeatCtrl', ['$scope', function($scope){
//Creating Angular Project Title
$scope.title = "Title";
//Initilal JSON Object
$scope.cats= [
{name:'John', age:25, gender:'boy'},
{name:'Jessie', age:30, gender:'girl'},
{name:'Johanna', age:28, gender:'girl'},
{name:'Joy', age:15, gender:'girl'},
{name:'Mary', age:28, gender:'girl'},
{name:'Peter', age:95, gender:'boy'},
{name:'Sebastian', age:50, gender:'boy'},
{name:'Erika', age:27, gender:'girl'},
{name:'Patrick', age:40, gender:'boy'},
{name:'Samantha', age:60, gender:'girl'}
];
}])
/*
---AngularJS Custom Filter---
For More Examples AngularJS
http://mehmetcanker.com
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment