Created
June 4, 2014 09:22
-
-
Save sayedmohamed/2b43778bafff63b11e70 to your computer and use it in GitHub Desktop.
Revisions
-
sayedmohamed created this gist
Jun 4, 2014 .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 @@ <!DOCTYPE html> <html ng-app='myapp'> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> <meta charset="utf-8"> <title>JS Bin</title> </head> <body> <div class="container" ng-controller='SimpleController'> search:<input type='text' ng-model='name'> <br /> <ul> <li ng-repeat='cust in customers|filter:name'>{{cust.name}} - {{cust.city}}</li> </ul> </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,23 @@ var myapp=angular.module('myapp',[]); myapp.config(function($routeProvider){ $routeProvider .when('/', { controller:'SimpleController', templateUrl:'partials/view1.html' }) .when('/partial2', { controller:'SimpleController', templateUrl:'partials/view2.html' }) .otherwise({redirectTo:'/'}); }); myapp.controller('SimpleController',function($scope){ $scope.customers=[ {name:'sayed',city:'cairo'}, {name:'ahamed',city:'alex'}, {name:'mohamed',city:'los anglous'} ]; });