Browse Source

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

David Leonard 10 years ago
parent
commit
9a904ecc6a
1 changed files with 10 additions and 0 deletions
  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);
+    });
+});