{"action":"created","issue":{"url":"https://api.github.com/repos/mgonto/restangular/issues/965","repository_url":"https://api.github.com/repos/mgonto/restangular","labels_url":"https://api.github.com/repos/mgonto/restangular/issues/965/labels{/name}","comments_url":"https://api.github.com/repos/mgonto/restangular/issues/965/comments","events_url":"https://api.github.com/repos/mgonto/restangular/issues/965/events","html_url":"https://github.com/mgonto/restangular/issues/965","id":50771190,"number":965,"title":"Using extendModel with Configurer to overwrite a Restangularized object's .post() method (app debug mode)","user":{"login":"lstone","id":972730,"avatar_url":"https://avatars.githubusercontent.com/u/972730?v=3","gravatar_id":"","url":"https://api.github.com/users/lstone","html_url":"https://github.com/lstone","followers_url":"https://api.github.com/users/lstone/followers","following_url":"https://api.github.com/users/lstone/following{/other_user}","gists_url":"https://api.github.com/users/lstone/gists{/gist_id}","starred_url":"https://api.github.com/users/lstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lstone/subscriptions","organizations_url":"https://api.github.com/users/lstone/orgs","repos_url":"https://api.github.com/users/lstone/repos","events_url":"https://api.github.com/users/lstone/events{/privacy}","received_events_url":"https://api.github.com/users/lstone/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mgonto/restangular/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-03T03:12:27Z","updated_at":"2016-06-18T00:11:19Z","closed_at":null,"body":"I want to override the .post() method of a Restangularized object so that I can write a debug mode for the app I'm working on.  My reading led me to believe this would work. \r\n\r\nforms-service.coffee\r\n````\r\n  restAngular = Restangular.withConfig (Configurer) ->\r\n    # config here\r\n    Configurer.setBaseUrl('/api/v1')\r\n    Configurer.extendModel 'forms', (model) -> # TODO: if debug mode\r\n      model.post = ->\r\n        console.log 'post() method override!'\r\n      return model\r\n  _formService = restAngular.all('forms')\r\n````\r\n\r\nGiven the above extendModel I would expect the console.log 'post() method override!' to fire, but instead the original post() method fires off a POST to /api/v1.\r\nform-controller.coffee\r\n````\r\n$scope.form.post().then (response) ->\r\n  $log.log response\r\n````\r\nHow can I overwrite the post() method of a Restangularized object returned from the server? Thanks!"},"comment":{"url":"https://api.github.com/repos/mgonto/restangular/issues/comments/226908725","html_url":"https://github.com/mgonto/restangular/issues/965#issuecomment-226908725","issue_url":"https://api.github.com/repos/mgonto/restangular/issues/965","id":226908725,"user":{"login":"daviesgeek","id":2348508,"avatar_url":"https://avatars.githubusercontent.com/u/2348508?v=3","gravatar_id":"","url":"https://api.github.com/users/daviesgeek","html_url":"https://github.com/daviesgeek","followers_url":"https://api.github.com/users/daviesgeek/followers","following_url":"https://api.github.com/users/daviesgeek/following{/other_user}","gists_url":"https://api.github.com/users/daviesgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/daviesgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daviesgeek/subscriptions","organizations_url":"https://api.github.com/users/daviesgeek/orgs","repos_url":"https://api.github.com/users/daviesgeek/repos","events_url":"https://api.github.com/users/daviesgeek/events{/privacy}","received_events_url":"https://api.github.com/users/daviesgeek/received_events","type":"User","site_admin":false},"created_at":"2016-06-18T00:11:19Z","updated_at":"2016-06-18T00:11:19Z","body":"@lstone Can you provide an example like @grabbou requested?"}}
{"actor":{"display_login":"daviesgeek"}}