Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <section ng-app="myapp" ng-controller="mynews">
- <h2>뉴스 리스트</h2>
- <hr>
- <p class="text-right">
- <a href="write.php" class="btn btn-success">
- <i class="fas fa-pencil-alt"></i>
- 글쓰기
- </a>
- </p>
- <div>
- <form onsubmit="return false;">
- <div class="form-group">
- <input type="text" class="form-control" placeholder="검색어" ng-model="search">
- </div>
- </form>
- </div>
- <table class="table">
- <tr>
- <th class="text-center">번호</th>
- <th class="text-center">제목</th>
- <th class="text-center">글쓴이</th>
- <th class="text-center">날짜</th>
- <th class="text-center">조회</th>
- </tr>
- <tr ng-repeat="news in newslist | filter:search">
- <td>{{ news.id }}</td>
- <td>{{ news.title }}</td>
- <td>{{ news.writer }}</td>
- <td>{{ news.wdate }}</td>
- <td>{{ news.hit }}</td>
- </tr>
- </table>
- </section>
- <script>
- var app = angular.module("myapp", []);
- app.controller("mynews", function($scope, $http){
- $http.get("json.php").then(function(news){
- $scope.newslist = news.data;
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement