Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('app').controller('phoneBookCtrl', function($scope) {
- $scope.people = people;
- });
- var people = [
- {
- id: 1,
- first_name: 'Towney',
- last_name: 'Rowswell',
- email: 'trowswell0@fastcompany.com',
- ph_number: '5364763080',
- address: '1 Fairview Drive',
- city: 'Korenëvo'
- },
- {
- id: 2,
- first_name: 'Kesley',
- last_name: 'Kenryd',
- email: 'kkenryd1@hexun.com',
- ph_number: '1533697264',
- address: '13009 Birchwood Trail',
- city: 'Khŭjand'
- },
- {
- id: 3,
- first_name: 'Jule',
- last_name: 'Ollerearnshaw',
- email: 'jollerearnshaw2@miibeian.gov.cn',
- ph_number: '0740055372',
- address: '7 Truax Point',
- city: 'Tuohua'
- },
- {
- id: 4,
- first_name: 'Jobyna',
- last_name: 'Selvey',
- email: 'jselvey3@tumblr.com',
- ph_number: '4247344145',
- address: '8 Northview Terrace',
- city: 'Alupay'
- },
- {
- id: 5,
- first_name: 'Celia',
- last_name: 'Worssam',
- email: 'cworssam4@eepurl.com',
- ph_number: '4908964467',
- address: '5781 Maywood Center',
- city: 'Ebute Ikorodu'
- },
- {
- id: 6,
- first_name: 'Jaime',
- last_name: 'Chetter',
- email: 'jchetter5@ehow.com',
- ph_number: '1354847032',
- address: '8219 Jackson Court',
- city: 'Mirotice'
- },
- {
- id: 7,
- first_name: 'Itch',
- last_name: 'Jobbins',
- email: 'ijobbins6@blog.com',
- ph_number: '1756022046',
- address: '1 Rockefeller Avenue',
- city: 'Goussainville'
- },
- {
- id: 8,
- first_name: 'Jami',
- last_name: 'MacCosty',
- email: 'jmaccosty7@liveinternet.ru',
- ph_number: '2808166087',
- address: '18573 Nova Park',
- city: 'Nōgata'
- },
- {
- id: 9,
- first_name: 'Caryn',
- last_name: 'Every',
- email: 'cevery8@house.gov',
- ph_number: '5958231030',
- address: '127 Little Fleur Way',
- city: 'Al Fandaqūmīyah'
- },
- {
- id: 10,
- first_name: 'Janaya',
- last_name: 'Rallinshaw',
- email: 'jrallinshaw9@ning.com',
- ph_number: '4222347817',
- address: '3 Melody Way',
- city: 'Lukou'
- },
- {
- id: 11,
- first_name: 'Katharyn',
- last_name: 'Arnke',
- email: 'karnkea@slideshare.net',
- ph_number: '4973374970',
- address: '5321 Butterfield Place',
- city: 'Johanneshov'
- },
- {
- id: 12,
- first_name: 'Ravi',
- last_name: 'Hodgen',
- email: 'rhodgenb@wunderground.com',
- ph_number: '9916385971',
- address: '9781 Northland Lane',
- city: 'Yandian'
- },
- {
- id: 13,
- first_name: 'Hughie',
- last_name: 'Malarkey',
- email: 'hmalarkeyc@jugem.jp',
- ph_number: '1421157853',
- address: '067 Raven Circle',
- city: 'Pawing'
- },
- {
- id: 14,
- first_name: 'Angy',
- last_name: 'Whittlesey',
- email: 'awhittleseyd@diigo.com',
- ph_number: '2499158182',
- address: '902 School Street',
- city: 'Tavricheskoye'
- },
- {
- id: 15,
- first_name: 'Opal',
- last_name: 'Everwin',
- email: 'oeverwine@cargocollective.com',
- ph_number: '2448563578',
- address: '9 Orin Avenue',
- city: 'Zhangjiapan'
- },
- {
- id: 16,
- first_name: 'Renee',
- last_name: 'Bolitho',
- email: 'rbolithof@nhs.uk',
- ph_number: '9536495554',
- address: '78 Sugar Plaza',
- city: 'Novopavlovsk'
- },
- {
- id: 17,
- first_name: 'Hurlee',
- last_name: 'Gunningham',
- email: 'hgunninghamg@oracle.com',
- ph_number: '7533819586',
- address: '9788 Monica Junction',
- city: 'Joubb Jannîne'
- },
- {
- id: 18,
- first_name: 'Cathee',
- last_name: 'Whoolehan',
- email: 'cwhoolehanh@wordpress.com',
- ph_number: '7136852560',
- address: '673 Butternut Way',
- city: 'Boston'
- },
- {
- id: 19,
- first_name: 'Claire',
- last_name: 'Herley',
- email: 'cherleyi@prweb.com',
- ph_number: '2327393167',
- address: '2560 Bay Place',
- city: 'Ust’-Uda'
- },
- {
- id: 20,
- first_name: 'Amye',
- last_name: 'Tottem',
- email: 'atottemj@acquirethisname.com',
- ph_number: '3269685440',
- address: '1 4th Parkway',
- city: 'La Unión'
- },
- {
- id: 21,
- first_name: 'Tuesday',
- last_name: 'Brookson',
- email: 'tbrooksonk@cloudflare.com',
- ph_number: '9411289657',
- address: '9 Larry Junction',
- city: 'Kolbudy'
- },
- {
- id: 22,
- first_name: 'Jethro',
- last_name: 'Messager',
- email: 'jmessagerl@xinhuanet.com',
- ph_number: '5465001666',
- address: '127 Clarendon Drive',
- city: 'Nangen'
- },
- {
- id: 23,
- first_name: 'Jerry',
- last_name: 'Forsyth',
- email: 'jforsythm@biglobe.ne.jp',
- ph_number: '3220520537',
- address: '0 Erie Terrace',
- city: 'Pujiang'
- },
- {
- id: 24,
- first_name: 'Otis',
- last_name: 'Wycliffe',
- email: 'owycliffen@archive.org',
- ph_number: '3817719612',
- address: '699 Center Street',
- city: 'Liulimiao'
- },
- {
- id: 25,
- first_name: 'Madalena',
- last_name: 'Kaine',
- email: 'mkaineo@github.io',
- ph_number: '6815744582',
- address: '5496 Debs Plaza',
- city: 'Dualing'
- },
- {
- id: 26,
- first_name: 'Johnnie',
- last_name: 'Carlill',
- email: 'jcarlillp@123-reg.co.uk',
- ph_number: '5543252765',
- address: '109 Brickson Park Trail',
- city: 'Nanjiao'
- },
- {
- id: 27,
- first_name: 'Conant',
- last_name: 'Gaither',
- email: 'cgaitherq@yolasite.com',
- ph_number: '5496649145',
- address: '65520 Amoth Way',
- city: 'Mosopa'
- },
- {
- id: 28,
- first_name: 'Skipton',
- last_name: 'Udy',
- email: 'sudyr@nymag.com',
- ph_number: '4947456450',
- address: '78659 Larry Court',
- city: 'Kibiya'
- },
- {
- id: 29,
- first_name: 'Nellie',
- last_name: 'Cheley',
- email: 'ncheleys@economist.com',
- ph_number: '2189960487',
- address: '1519 Sachs Point',
- city: 'Chuncheng'
- },
- {
- id: 30,
- first_name: 'Betsey',
- last_name: 'Sabati',
- email: 'bsabatit@yahoo.co.jp',
- ph_number: '6004256153',
- address: '02191 Browning Avenue',
- city: 'Xiage'
- },
- {
- id: 31,
- first_name: 'Fedora',
- last_name: 'Strachan',
- email: 'fstrachanu@naver.com',
- ph_number: '3719597911',
- address: '42721 Butternut Park',
- city: 'San Antonio de Los Altos'
- },
- {
- id: 32,
- first_name: 'Talbert',
- last_name: 'Flay',
- email: 'tflayv@dmoz.org',
- ph_number: '4379470709',
- address: '2 American Ash Way',
- city: 'Mawa'
- },
- {
- id: 33,
- first_name: 'Guido',
- last_name: 'Spinney',
- email: 'gspinneyw@tinyurl.com',
- ph_number: '0793675154',
- address: '66657 Hovde Pass',
- city: 'Turku'
- },
- {
- id: 34,
- first_name: 'Violette',
- last_name: 'Geely',
- email: 'vgeelyx@typepad.com',
- ph_number: '2143824300',
- address: '948 Nancy Center',
- city: 'Zambujeira do Mar'
- },
- {
- id: 35,
- first_name: 'Georgetta',
- last_name: 'Borrington',
- email: 'gborringtony@prweb.com',
- ph_number: '3918030202',
- address: '35119 Waxwing Crossing',
- city: 'Karlstad'
- },
- {
- id: 36,
- first_name: 'Theodora',
- last_name: 'Laflin',
- email: 'tlaflinz@spotify.com',
- ph_number: '7165046356',
- address: '5379 Brown Avenue',
- city: 'Minūf'
- },
- {
- id: 37,
- first_name: 'Robina',
- last_name: 'Verecker',
- email: 'rverecker10@unblog.fr',
- ph_number: '4040626559',
- address: '50589 Esch Terrace',
- city: 'Oak Bay'
- },
- {
- id: 38,
- first_name: 'Cecily',
- last_name: 'Aronowicz',
- email: 'caronowicz11@mac.com',
- ph_number: '3970641217',
- address: '149 Kipling Way',
- city: 'Bun Barat'
- },
- {
- id: 39,
- first_name: 'Lyndsay',
- last_name: 'Hanner',
- email: 'lhanner12@jalbum.net',
- ph_number: '6656744672',
- address: '0617 Derek Pass',
- city: 'Emiliano Zapata'
- },
- {
- id: 40,
- first_name: 'Findlay',
- last_name: 'Itzhayek',
- email: 'fitzhayek13@people.com.cn',
- ph_number: '8253885555',
- address: '038 Anniversary Pass',
- city: 'El Hajeb'
- },
- {
- id: 41,
- first_name: 'Dale',
- last_name: 'Robert',
- email: 'drobert14@4shared.com',
- ph_number: '4399896264',
- address: '14025 Utah Point',
- city: 'Potosí'
- },
- {
- id: 42,
- first_name: 'Cob',
- last_name: 'Shewon',
- email: 'cshewon15@quantcast.com',
- ph_number: '0791097072',
- address: '37 Hagan Lane',
- city: 'Colotenango'
- },
- {
- id: 43,
- first_name: 'Karry',
- last_name: 'Nicely',
- email: 'knicely16@usgs.gov',
- ph_number: '9848986103',
- address: '79141 Coleman Terrace',
- city: 'Bejsce'
- },
- {
- id: 44,
- first_name: 'Sunny',
- last_name: 'Ney',
- email: 'sney17@w3.org',
- ph_number: '4308866413',
- address: '92 Kenwood Trail',
- city: 'Benito Juarez'
- },
- {
- id: 45,
- first_name: 'Robbie',
- last_name: 'Wallington',
- email: 'rwallington18@nymag.com',
- ph_number: '2643381971',
- address: '8919 Fairfield Alley',
- city: 'Taibai'
- },
- {
- id: 46,
- first_name: 'Teador',
- last_name: 'Fishe',
- email: 'tfishe19@engadget.com',
- ph_number: '2113245426',
- address: '9005 Eagle Crest Way',
- city: 'Zuitou'
- },
- {
- id: 47,
- first_name: 'Boigie',
- last_name: 'Jaime',
- email: 'bjaime1a@umn.edu',
- ph_number: '6523594254',
- address: '900 Straubel Alley',
- city: 'Żółkiewka'
- },
- {
- id: 48,
- first_name: 'Selena',
- last_name: 'Gately',
- email: 'sgately1b@last.fm',
- ph_number: '5241067566',
- address: '974 Debra Drive',
- city: 'Pinega'
- },
- {
- id: 49,
- first_name: 'Oberon',
- last_name: 'Hassey',
- email: 'ohassey1c@icq.com',
- ph_number: '2951861478',
- address: '8 Cody Parkway',
- city: 'Hidalgo'
- },
- {
- id: 50,
- first_name: 'Arie',
- last_name: 'Barlace',
- email: 'abarlace1d@dmoz.org',
- ph_number: '9042980605',
- address: '90511 Duke Road',
- city: 'Aramayuan'
- }
- ];
- <!DOCTYPE html>
- <html ng-app="app">
- <head>
- <meta charset="utf-8">
- <link rel="icon" href="data:;base64,iVBORw0KGgo=">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
- <title></title>
- </head>
- <body ng-controller="phoneBookCtrl">
- <input type="text" name="" value="" ng-model="filter.first_name" placeholder="First Name">
- <input type="text" name="" value="" ng-model="filter.ph_number" placeholder="Phone Number">
- <div class="">
- <hr>
- <input type="text" ng-model="newContact.first_name" placeholder="first_name" name="" value="">
- <input type="text" ng-model="newContact.last_name" placeholder="last_name" name="" value="">
- <input type="text" ng-model="newContact.email" placeholder="email" name="" value="">
- <input type="text" ng-model="newContact.ph_number" placeholder="ph_number" name="" value="">
- <input type="text" ng-model="newContact.address" placeholder="address" name="" value="">
- <input type="text" ng-model="newContact.city" placeholder="city" name="" value="">
- </div>
- <div ng-repeat="person in people | filter: filter">
- Name: {{ person.first_name }} {{person.last_name}} <br>
- Email: {{ person.email }} <br>
- Phone: {{ person.ph_number }} <br>
- Address: {{ person.address }} {{ person.city }} <br>
- <hr>
- </div>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.js"></script>
- <script src="./js/app.js"></script>
- <script src="./js/ctrl.js"></script>
- <script src="./js/service.js"></script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment