소스 검색

Adding controller for grabbing data from Django RESTful API and passing it to the partial

David Leonard 10 년 전
부모
커밋
9a904ecc6a
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      public/scripts/controllers/restAppController.js

+ 10 - 0
public/scripts/controllers/restAppController.js

@@ -0,0 +1,10 @@
+'use strict';
+
+restApp.controller('restAppController', function($scope, restAppFactory) {
+    $scope.restData = {};
+    
+    $scope.restData = restAppFactory.get().success(function(data) {
+    	$scope.restData = data;
+    	console.log(data);
+    });
+});