Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>AngularJS - 1</title>
- </head>
- <body ng-app="myapp" ng-controller="myfriends">
- <input type="text" id="name" ng-model="hi">
- <div id="show">{{hi}}</div>
- <ul>
- <li ng-repeat="friend in friends">
- {{friend.name}}, {{friend.phone}}
- </li>
- </ul>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
- <script>
- var app = angular.module("myapp",[]);
- app.controller("myfriends",function($scope){
- $scope.friends = [
- {
- "name": "홍길동",
- "phone": "010-1234-5678"
- },
- {
- "name": "김영철",
- "phone": "010-5555-4475"
- },
- {
- "name": "송고은",
- "phone": "010-7787-9874"
- },
- {
- "name": "박승한",
- "phone": "010-1111-2222"
- },
- {
- "name": "이미연",
- "phone": "010-3333-5555"
- }
- ];
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement