Browse Source

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

David Leonard 10 năm trước cách đây
mục cha
commit
9a904ecc6a
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  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);
+    });
+});