Guest User

Untitled

a guest
May 2nd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. app.factory('sveKlupeServiceFactory', ['$resource',
  2. function($resource){
  3. var data = $resource('xxxxxx', {klupa: '@klupa'},{
  4. query: { method: 'GET', isArray:false},
  5. save : {
  6. method : 'POST',
  7. url : "//api-dev.steora.com/control-board/smartbenches",
  8. headers: {
  9. 'Content-Type': 'application/x-ww-form-urlencoded'
  10. },
  11. }
  12. });
  13. return data;
  14.  
  15. .controller('klupeController', ['$scope', 'sveKlupeServiceFactory', function ($scope,sveKlupeServiceFactory){
  16. sveKlupeServiceFactory.query(function(res){
  17. $scope.klupe = res.smart_benches;
  18. });
  19. $scope.setDataForKlupa = function(klupaID){
  20. $scope.currentKlupa = sveKlupeServiceFactory.get({klupa: klupaID});
  21. };
  22.  
  23. $scope.addKlupa = function(){ sveKlupeServiceFactory.save($scope.addKlupa););};
  24.  
  25. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 400.
  26.  
  27. Access-Control-Allow-Headers: Content-Type
  28. Access-Control-Allow-Methods: GET, POST, OPTIONS
  29. Access-Control-Allow-Origin: *
Add Comment
Please, Sign In to add comment