Skip to content

Inject resolved value into onExit function. #3081

Closed
@Dav1dde

Description

@Dav1dde

I have a state like this:

.state('design', {
    url: '/design',
    templateUrl: 'design.html',
    resolve: {
        cc: ['$stateParams', 'configuratorService', function ($stateParams, configuratorService) {
            return configuratorService.update($stateParams, true);
        }]
    },
    onExit: ['cc', '$state', function (cc, $state) {
        console.log(cc);
    }]
}

When I leave the state, I always get this exception: Error: [$injector:unpr] Unknown provider: ccProvider <- cc. This used to work with angular-ui-router v0.2.18.

I also tried basically any combination of $state.transition.injector().get('cc') and $transition$.injector().get('cc') it seems to only be able to get the variables of the next state.

In short: Is there a way to get the values resolved when entering the state in the corresponding onExit function?

Angular 1.5.5, [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions