Advertisement
asimryu

index3.php for rss read

Jun 27th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.14 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="ko">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>AngularJS</title>
  6.     <link rel="stylesheet" href="css/bootstrap.css">
  7.     <script src="js/angular.min.js"></script>
  8.     <script src="js/jquery-3.2.1.min.js"></script>
  9. </head>
  10. <body>
  11.     <div class="container" ng-app="myApp" ng-controller="blog">
  12.         <h1>Naver</h1>
  13.             <form action="">
  14.                 <input type="text" class="form-control" ng-model="sch" ng-keyup="getnews()" placeholder="뉴스검색...">
  15.             </form>
  16.         <table class="table">
  17.             <tr class="active">
  18.                 <td>구분</td>
  19.                 <td>제목</td>
  20.                 <td>언론사</td>
  21.                 <td>날짜</td>
  22.             </tr>
  23.             <tr ng-repeat="post in posts">
  24.                 <td>{{post.category[0]}}</td>
  25.                 <td><a href="{{ post.link[0] }}" target="_blank">{{post.title[0]}}</a></td>
  26.                 <td>{{post.author[0]}}</td>
  27.                 <td>{{post.pubDate[0]}}</td>
  28.             </tr>
  29.         </table>
  30.     </div>
  31.     <script>
  32.         var app = angular.module('myApp',[]);
  33.         app.controller("blog",function($scope,$http){
  34.             $scope.getnews = function(){
  35.                 $http.get("naver.php?sch=" + $scope.sch).then(function(json){
  36.                         $scope.posts = json.data;
  37.                 });            
  38.             }
  39.         });
  40.     </script>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement