Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$asPromise() has no catch() method #183

Closed
jacek-dargiel opened this issue Oct 17, 2014 · 3 comments
Closed

$asPromise() has no catch() method #183

jacek-dargiel opened this issue Oct 17, 2014 · 3 comments
Labels
Milestone

Comments

@jacek-dargiel
Copy link

It has then() and finally(), but no catch().

@iobaixas iobaixas added the bug label Oct 17, 2014
@iobaixas
Copy link
Member

Thanks!, I'll fix it as soon as posible

@rbarilani
Copy link

+1

@iobaixas iobaixas added the ready label Dec 10, 2014
@iobaixas iobaixas added this to the 1.2 milestone Dec 10, 2014
@wmluke
Copy link

wmluke commented Dec 20, 2014

As a temporary workaround until 1.2 is released, I did the following...

module
    .config(['restmodProvider', function (restmodProvider) {
        restmodProvider.rebase('AsPromisePatch');
    }])
    .factory('AsPromisePatch', ['restmod', '$q', function (restmod, $q) {
        return restmod.mixin(function () {
            // decorate `$asPromise` to run the result through `$q.when`
            this.define('Resource.$asPromise', function () {
                return $q.when(this.$super());
            });
        });
    }]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants