그누보드 데이타를 JSONP로 읽어서

Angular.js로 처리해 보고 있습니다.

 

[code]

angular.module('', []);

 

function DataCtrl($scope, $http) {

  

  $http.jsonp("http://localhost/gb51/restful/api/v1/board/gallery?callback=JSON_CALLBACK").

  success(function(data) {

    $scope.data = data;

    $scope.boards = data.boards;

  }).

  error(function (data) {

    $scope.data = "Request failed";

  });

[/code]

간단하게 index.html에서 아래 처럼 볼수 있습니다.

[code]

  <div ng-controller="DataCtrl">

  <ul>

    <li ng-repeat="board in boards">

    {{ board.wr_subject }}  

    </li>

  </ul>

</div> 

[/code]

|

댓글 1개

다음은 ng-route 처리 그리고 페이지 처리, Comments 처리 순인 것 같습니다.

다음으로 onsen ui나 ionic을 입히면 될것 같습니다.

지금은 angular.js에 집중...

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기
🐛 버그신고