Advertisement
asimryu

angularjs - 1

Oct 17th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.92 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>AngularJS - 1</title>
  6. </head>
  7. <body ng-app="myapp" ng-controller="myfriends">
  8.     <input type="text" id="name" ng-model="hi">
  9.     <div id="show">{{hi}}</div>
  10.     <ul>
  11.         <li ng-repeat="friend in friends">
  12.             {{friend.name}}, {{friend.phone}}
  13.         </li>
  14.     </ul>
  15.     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
  16.     <script>
  17.         var app = angular.module("myapp",[]);
  18.         app.controller("myfriends",function($scope){
  19.             $scope.friends = [
  20.                 {
  21.                     "name": "홍길동",
  22.                     "phone": "010-1234-5678"
  23.                 },
  24.                 {
  25.                     "name": "김영철",
  26.                     "phone": "010-5555-4475"
  27.                 },
  28.                 {
  29.                     "name": "송고은",
  30.                     "phone": "010-7787-9874"
  31.                 },
  32.                 {
  33.                     "name": "박승한",
  34.                     "phone": "010-1111-2222"
  35.                 },
  36.                 {
  37.                     "name": "이미연",
  38.                     "phone": "010-3333-5555"
  39.                 }
  40.             ];
  41.         });
  42.     </script>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement