I use restangular, but I have a problem with the "Put" method, but it does not work as expected
My angular service code
var userService = function (restangular) { var resourceBase = restangular.all("account/"); restangular.addResponseInterceptor(function (data, operation, what, url, response, deferred) { if (operation == "getList") { return response.data; } return response; }); this.getUserById = function (id) { return resourceBase.get(id);
My controller code
var userEditController = function (scope, userService, feedBackFactory, $routeParams) { scope.user = undefined; scope.updateUser = function () { userService.updateUser(scope.user).then(function (data) { feedBackFactory.showFeedBack(data); }, function (err) { feedBackFactory.showFeedBack(err); }); }; userService.getUserById($routeParams.id).then(function (data) { scope.user = data.data; **
but I get the error message “Put” is not a function, I checked the user object and I found that the user object is not restangularized (no additional methods were found). How can i solve this problem
source share