فهرست منبع

Adding factory method for getting sample data from RESTful Django endpoint

David Leonard 10 سال پیش
والد
کامیت
015a5548ad
1فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 12 0
      public/scripts/factories/restAppFactory.js

+ 12 - 0
public/scripts/factories/restAppFactory.js

@@ -0,0 +1,12 @@
+'use strict';
+
+restApp.factory('restAppFactory', function($http) {
+    return {
+        get: function() {
+            return $http({
+                url: 'http://127.0.0.1:8000/hackathon/snippets/',
+                method: 'GET',
+            });
+        }
+    };
+});