Angularjs 1.7.9 - Possibly unhandled rejection

637 Views Asked by At

I constantly have this error Possibly unhandled rejection even when using $promise.then(success, err) or $promise.then(success).catch(err)

What should I do to fix this error. Thanks


this is the code

this.User = $injector.get('User');
this.User.get(id).$promise
.then(fn, fn)

in the User resource:

class UserResource {
    constructor($resource) {
        'ngInject';
        this.$resource = $resource;
    }
    get(id) {
        return this.$resource(apis.user + id).get();
    }
}
0

There are 0 best solutions below