| mainApp.factory('RegisterFactor', function($resource) { | |
| return $resource('/api/brands/:pk/', {'pk': '@pk'}, { | |
| 'create': { | |
| method: 'POST', | |
| transformRequest: transformImageRequest, | |
| headers: {'Content-Type':undefined} | |
| }, | |
| }); | |
| }); | |
| $scope.postRegistration = function(form) | |
| { | |
| console.log(form); | |
| RegisterFactor.create(form).$promise.then( | |
| function(response) { | |
| toaster.pop('success', "Paskyra sėkmingai sukurta!"); | |
| }, | |
| function(rejection) { | |
| toaster.pop('error', "Registracija nepavyko"); | |
| console.log(rejection); | |
| } | |
| ); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment