Guest User

Untitled

a guest
Sep 5th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.58 KB | None | 0 0
  1. angular.module('app').controller('phoneBookCtrl', function($scope) {
  2. $scope.people = people;
  3. });
  4.  
  5. var people = [
  6. {
  7. id: 1,
  8. first_name: 'Towney',
  9. last_name: 'Rowswell',
  10. email: 'trowswell0@fastcompany.com',
  11. ph_number: '5364763080',
  12. address: '1 Fairview Drive',
  13. city: 'Korenëvo'
  14. },
  15. {
  16. id: 2,
  17. first_name: 'Kesley',
  18. last_name: 'Kenryd',
  19. email: 'kkenryd1@hexun.com',
  20. ph_number: '1533697264',
  21. address: '13009 Birchwood Trail',
  22. city: 'Khŭjand'
  23. },
  24. {
  25. id: 3,
  26. first_name: 'Jule',
  27. last_name: 'Ollerearnshaw',
  28. email: 'jollerearnshaw2@miibeian.gov.cn',
  29. ph_number: '0740055372',
  30. address: '7 Truax Point',
  31. city: 'Tuohua'
  32. },
  33. {
  34. id: 4,
  35. first_name: 'Jobyna',
  36. last_name: 'Selvey',
  37. email: 'jselvey3@tumblr.com',
  38. ph_number: '4247344145',
  39. address: '8 Northview Terrace',
  40. city: 'Alupay'
  41. },
  42. {
  43. id: 5,
  44. first_name: 'Celia',
  45. last_name: 'Worssam',
  46. email: 'cworssam4@eepurl.com',
  47. ph_number: '4908964467',
  48. address: '5781 Maywood Center',
  49. city: 'Ebute Ikorodu'
  50. },
  51. {
  52. id: 6,
  53. first_name: 'Jaime',
  54. last_name: 'Chetter',
  55. email: 'jchetter5@ehow.com',
  56. ph_number: '1354847032',
  57. address: '8219 Jackson Court',
  58. city: 'Mirotice'
  59. },
  60. {
  61. id: 7,
  62. first_name: 'Itch',
  63. last_name: 'Jobbins',
  64. email: 'ijobbins6@blog.com',
  65. ph_number: '1756022046',
  66. address: '1 Rockefeller Avenue',
  67. city: 'Goussainville'
  68. },
  69. {
  70. id: 8,
  71. first_name: 'Jami',
  72. last_name: 'MacCosty',
  73. email: 'jmaccosty7@liveinternet.ru',
  74. ph_number: '2808166087',
  75. address: '18573 Nova Park',
  76. city: 'Nōgata'
  77. },
  78. {
  79. id: 9,
  80. first_name: 'Caryn',
  81. last_name: 'Every',
  82. email: 'cevery8@house.gov',
  83. ph_number: '5958231030',
  84. address: '127 Little Fleur Way',
  85. city: 'Al Fandaqūmīyah'
  86. },
  87. {
  88. id: 10,
  89. first_name: 'Janaya',
  90. last_name: 'Rallinshaw',
  91. email: 'jrallinshaw9@ning.com',
  92. ph_number: '4222347817',
  93. address: '3 Melody Way',
  94. city: 'Lukou'
  95. },
  96. {
  97. id: 11,
  98. first_name: 'Katharyn',
  99. last_name: 'Arnke',
  100. email: 'karnkea@slideshare.net',
  101. ph_number: '4973374970',
  102. address: '5321 Butterfield Place',
  103. city: 'Johanneshov'
  104. },
  105. {
  106. id: 12,
  107. first_name: 'Ravi',
  108. last_name: 'Hodgen',
  109. email: 'rhodgenb@wunderground.com',
  110. ph_number: '9916385971',
  111. address: '9781 Northland Lane',
  112. city: 'Yandian'
  113. },
  114. {
  115. id: 13,
  116. first_name: 'Hughie',
  117. last_name: 'Malarkey',
  118. email: 'hmalarkeyc@jugem.jp',
  119. ph_number: '1421157853',
  120. address: '067 Raven Circle',
  121. city: 'Pawing'
  122. },
  123. {
  124. id: 14,
  125. first_name: 'Angy',
  126. last_name: 'Whittlesey',
  127. email: 'awhittleseyd@diigo.com',
  128. ph_number: '2499158182',
  129. address: '902 School Street',
  130. city: 'Tavricheskoye'
  131. },
  132. {
  133. id: 15,
  134. first_name: 'Opal',
  135. last_name: 'Everwin',
  136. email: 'oeverwine@cargocollective.com',
  137. ph_number: '2448563578',
  138. address: '9 Orin Avenue',
  139. city: 'Zhangjiapan'
  140. },
  141. {
  142. id: 16,
  143. first_name: 'Renee',
  144. last_name: 'Bolitho',
  145. email: 'rbolithof@nhs.uk',
  146. ph_number: '9536495554',
  147. address: '78 Sugar Plaza',
  148. city: 'Novopavlovsk'
  149. },
  150. {
  151. id: 17,
  152. first_name: 'Hurlee',
  153. last_name: 'Gunningham',
  154. email: 'hgunninghamg@oracle.com',
  155. ph_number: '7533819586',
  156. address: '9788 Monica Junction',
  157. city: 'Joubb Jannîne'
  158. },
  159. {
  160. id: 18,
  161. first_name: 'Cathee',
  162. last_name: 'Whoolehan',
  163. email: 'cwhoolehanh@wordpress.com',
  164. ph_number: '7136852560',
  165. address: '673 Butternut Way',
  166. city: 'Boston'
  167. },
  168. {
  169. id: 19,
  170. first_name: 'Claire',
  171. last_name: 'Herley',
  172. email: 'cherleyi@prweb.com',
  173. ph_number: '2327393167',
  174. address: '2560 Bay Place',
  175. city: 'Ust’-Uda'
  176. },
  177. {
  178. id: 20,
  179. first_name: 'Amye',
  180. last_name: 'Tottem',
  181. email: 'atottemj@acquirethisname.com',
  182. ph_number: '3269685440',
  183. address: '1 4th Parkway',
  184. city: 'La Unión'
  185. },
  186. {
  187. id: 21,
  188. first_name: 'Tuesday',
  189. last_name: 'Brookson',
  190. email: 'tbrooksonk@cloudflare.com',
  191. ph_number: '9411289657',
  192. address: '9 Larry Junction',
  193. city: 'Kolbudy'
  194. },
  195. {
  196. id: 22,
  197. first_name: 'Jethro',
  198. last_name: 'Messager',
  199. email: 'jmessagerl@xinhuanet.com',
  200. ph_number: '5465001666',
  201. address: '127 Clarendon Drive',
  202. city: 'Nangen'
  203. },
  204. {
  205. id: 23,
  206. first_name: 'Jerry',
  207. last_name: 'Forsyth',
  208. email: 'jforsythm@biglobe.ne.jp',
  209. ph_number: '3220520537',
  210. address: '0 Erie Terrace',
  211. city: 'Pujiang'
  212. },
  213. {
  214. id: 24,
  215. first_name: 'Otis',
  216. last_name: 'Wycliffe',
  217. email: 'owycliffen@archive.org',
  218. ph_number: '3817719612',
  219. address: '699 Center Street',
  220. city: 'Liulimiao'
  221. },
  222. {
  223. id: 25,
  224. first_name: 'Madalena',
  225. last_name: 'Kaine',
  226. email: 'mkaineo@github.io',
  227. ph_number: '6815744582',
  228. address: '5496 Debs Plaza',
  229. city: 'Dualing'
  230. },
  231. {
  232. id: 26,
  233. first_name: 'Johnnie',
  234. last_name: 'Carlill',
  235. email: 'jcarlillp@123-reg.co.uk',
  236. ph_number: '5543252765',
  237. address: '109 Brickson Park Trail',
  238. city: 'Nanjiao'
  239. },
  240. {
  241. id: 27,
  242. first_name: 'Conant',
  243. last_name: 'Gaither',
  244. email: 'cgaitherq@yolasite.com',
  245. ph_number: '5496649145',
  246. address: '65520 Amoth Way',
  247. city: 'Mosopa'
  248. },
  249. {
  250. id: 28,
  251. first_name: 'Skipton',
  252. last_name: 'Udy',
  253. email: 'sudyr@nymag.com',
  254. ph_number: '4947456450',
  255. address: '78659 Larry Court',
  256. city: 'Kibiya'
  257. },
  258. {
  259. id: 29,
  260. first_name: 'Nellie',
  261. last_name: 'Cheley',
  262. email: 'ncheleys@economist.com',
  263. ph_number: '2189960487',
  264. address: '1519 Sachs Point',
  265. city: 'Chuncheng'
  266. },
  267. {
  268. id: 30,
  269. first_name: 'Betsey',
  270. last_name: 'Sabati',
  271. email: 'bsabatit@yahoo.co.jp',
  272. ph_number: '6004256153',
  273. address: '02191 Browning Avenue',
  274. city: 'Xiage'
  275. },
  276. {
  277. id: 31,
  278. first_name: 'Fedora',
  279. last_name: 'Strachan',
  280. email: 'fstrachanu@naver.com',
  281. ph_number: '3719597911',
  282. address: '42721 Butternut Park',
  283. city: 'San Antonio de Los Altos'
  284. },
  285. {
  286. id: 32,
  287. first_name: 'Talbert',
  288. last_name: 'Flay',
  289. email: 'tflayv@dmoz.org',
  290. ph_number: '4379470709',
  291. address: '2 American Ash Way',
  292. city: 'Mawa'
  293. },
  294. {
  295. id: 33,
  296. first_name: 'Guido',
  297. last_name: 'Spinney',
  298. email: 'gspinneyw@tinyurl.com',
  299. ph_number: '0793675154',
  300. address: '66657 Hovde Pass',
  301. city: 'Turku'
  302. },
  303. {
  304. id: 34,
  305. first_name: 'Violette',
  306. last_name: 'Geely',
  307. email: 'vgeelyx@typepad.com',
  308. ph_number: '2143824300',
  309. address: '948 Nancy Center',
  310. city: 'Zambujeira do Mar'
  311. },
  312. {
  313. id: 35,
  314. first_name: 'Georgetta',
  315. last_name: 'Borrington',
  316. email: 'gborringtony@prweb.com',
  317. ph_number: '3918030202',
  318. address: '35119 Waxwing Crossing',
  319. city: 'Karlstad'
  320. },
  321. {
  322. id: 36,
  323. first_name: 'Theodora',
  324. last_name: 'Laflin',
  325. email: 'tlaflinz@spotify.com',
  326. ph_number: '7165046356',
  327. address: '5379 Brown Avenue',
  328. city: 'Minūf'
  329. },
  330. {
  331. id: 37,
  332. first_name: 'Robina',
  333. last_name: 'Verecker',
  334. email: 'rverecker10@unblog.fr',
  335. ph_number: '4040626559',
  336. address: '50589 Esch Terrace',
  337. city: 'Oak Bay'
  338. },
  339. {
  340. id: 38,
  341. first_name: 'Cecily',
  342. last_name: 'Aronowicz',
  343. email: 'caronowicz11@mac.com',
  344. ph_number: '3970641217',
  345. address: '149 Kipling Way',
  346. city: 'Bun Barat'
  347. },
  348. {
  349. id: 39,
  350. first_name: 'Lyndsay',
  351. last_name: 'Hanner',
  352. email: 'lhanner12@jalbum.net',
  353. ph_number: '6656744672',
  354. address: '0617 Derek Pass',
  355. city: 'Emiliano Zapata'
  356. },
  357. {
  358. id: 40,
  359. first_name: 'Findlay',
  360. last_name: 'Itzhayek',
  361. email: 'fitzhayek13@people.com.cn',
  362. ph_number: '8253885555',
  363. address: '038 Anniversary Pass',
  364. city: 'El Hajeb'
  365. },
  366. {
  367. id: 41,
  368. first_name: 'Dale',
  369. last_name: 'Robert',
  370. email: 'drobert14@4shared.com',
  371. ph_number: '4399896264',
  372. address: '14025 Utah Point',
  373. city: 'Potosí'
  374. },
  375. {
  376. id: 42,
  377. first_name: 'Cob',
  378. last_name: 'Shewon',
  379. email: 'cshewon15@quantcast.com',
  380. ph_number: '0791097072',
  381. address: '37 Hagan Lane',
  382. city: 'Colotenango'
  383. },
  384. {
  385. id: 43,
  386. first_name: 'Karry',
  387. last_name: 'Nicely',
  388. email: 'knicely16@usgs.gov',
  389. ph_number: '9848986103',
  390. address: '79141 Coleman Terrace',
  391. city: 'Bejsce'
  392. },
  393. {
  394. id: 44,
  395. first_name: 'Sunny',
  396. last_name: 'Ney',
  397. email: 'sney17@w3.org',
  398. ph_number: '4308866413',
  399. address: '92 Kenwood Trail',
  400. city: 'Benito Juarez'
  401. },
  402. {
  403. id: 45,
  404. first_name: 'Robbie',
  405. last_name: 'Wallington',
  406. email: 'rwallington18@nymag.com',
  407. ph_number: '2643381971',
  408. address: '8919 Fairfield Alley',
  409. city: 'Taibai'
  410. },
  411. {
  412. id: 46,
  413. first_name: 'Teador',
  414. last_name: 'Fishe',
  415. email: 'tfishe19@engadget.com',
  416. ph_number: '2113245426',
  417. address: '9005 Eagle Crest Way',
  418. city: 'Zuitou'
  419. },
  420. {
  421. id: 47,
  422. first_name: 'Boigie',
  423. last_name: 'Jaime',
  424. email: 'bjaime1a@umn.edu',
  425. ph_number: '6523594254',
  426. address: '900 Straubel Alley',
  427. city: 'Żółkiewka'
  428. },
  429. {
  430. id: 48,
  431. first_name: 'Selena',
  432. last_name: 'Gately',
  433. email: 'sgately1b@last.fm',
  434. ph_number: '5241067566',
  435. address: '974 Debra Drive',
  436. city: 'Pinega'
  437. },
  438. {
  439. id: 49,
  440. first_name: 'Oberon',
  441. last_name: 'Hassey',
  442. email: 'ohassey1c@icq.com',
  443. ph_number: '2951861478',
  444. address: '8 Cody Parkway',
  445. city: 'Hidalgo'
  446. },
  447. {
  448. id: 50,
  449. first_name: 'Arie',
  450. last_name: 'Barlace',
  451. email: 'abarlace1d@dmoz.org',
  452. ph_number: '9042980605',
  453. address: '90511 Duke Road',
  454. city: 'Aramayuan'
  455. }
  456. ];
  457.  
  458.  
  459.  
  460. <!DOCTYPE html>
  461. <html ng-app="app">
  462. <head>
  463. <meta charset="utf-8">
  464. <link rel="icon" href="data:;base64,iVBORw0KGgo=">
  465. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
  466. <title></title>
  467. </head>
  468. <body ng-controller="phoneBookCtrl">
  469. <input type="text" name="" value="" ng-model="filter.first_name" placeholder="First Name">
  470. <input type="text" name="" value="" ng-model="filter.ph_number" placeholder="Phone Number">
  471. <div class="">
  472. <hr>
  473. <input type="text" ng-model="newContact.first_name" placeholder="first_name" name="" value="">
  474. <input type="text" ng-model="newContact.last_name" placeholder="last_name" name="" value="">
  475. <input type="text" ng-model="newContact.email" placeholder="email" name="" value="">
  476. <input type="text" ng-model="newContact.ph_number" placeholder="ph_number" name="" value="">
  477. <input type="text" ng-model="newContact.address" placeholder="address" name="" value="">
  478. <input type="text" ng-model="newContact.city" placeholder="city" name="" value="">
  479. </div>
  480. <div ng-repeat="person in people | filter: filter">
  481. Name: {{ person.first_name }} {{person.last_name}} <br>
  482. Email: {{ person.email }} <br>
  483. Phone: {{ person.ph_number }} <br>
  484. Address: {{ person.address }} {{ person.city }} <br>
  485. <hr>
  486. </div>
  487.  
  488. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.js"></script>
  489. <script src="./js/app.js"></script>
  490. <script src="./js/ctrl.js"></script>
  491. <script src="./js/service.js"></script>
  492. </body>
  493. </html>
Add Comment
Please, Sign In to add comment