Skip to content

State transition occurring before resolving dependency #2048

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

Closed
LeonanCarvalho opened this issue Jun 18, 2015 · 5 comments
Closed

State transition occurring before resolving dependency #2048

LeonanCarvalho opened this issue Jun 18, 2015 · 5 comments

Comments

@LeonanCarvalho
Copy link

I think i'm getting a related issue than #2047, but the scenarios is different and I'm using a 3th-party plugin to resolve my dependencies.

The problem is the state transition is occurring before resolve dependencies. For this reason the controller isn't loaded on mudule.

.state('app.config.params', {
                    url: '/params',
                    data: {
                        modulo: '00.000.00',
                        title: 'Params Config',
                        access: access.user
                    },
                    views: {
                        "content@app": {
                            templateUrl: 'app/modules/_admin/config/views/params/index.html',
                            controller: 'paramsController',
                            resolve: {
//At version 0.2.14 its works fine, in 0.2.15 does not.
                                deps: $couchPotatoProvider.resolveDependencies([
                                    'modules/_admin/config/controllers/paramsController'
                                ])
                            }
                        }
                    }
                })

$couchPotato is a component that Lazy-Load and Register Components in AngularJS Applications

I'm using angular 1.4.1

@eddiemonge eddiemonge changed the title State transition occurring before resolve dependencie State transition occurring before resolving dependency Jun 24, 2015
@eddiemonge eddiemonge added the bug label Jun 24, 2015
@eddiemonge
Copy link
Contributor

This could potentially be a bug but I'm not sure if it should be solved here or at $couchPotato. It would seem here since it works in one version and not the next.

@LeonanCarvalho
Copy link
Author

$couchPotato returns a function, The goal should resolve this function, isn't it?

I think not, because the same version of couchPotato works with 0.2.14, something has changed to 0.2.15?

@cah-ricksuggs
Copy link

I've encountered a similar issue after upgrading to version 0.2.15

When initially transitioning to a route, the dependencies are resolved and controller is executed. However when revisiting the same route after navigating away, the controller is executed, then dependencies are resolved, and the state transition finally occurs.

It appears to be a regression because after downgrading to version 0.2.14 the issue no longer occurs.

@christopherthielen
Copy link
Contributor

Move the resolve out of the view, and into the state definition.

resolve: {} is a state-level thing, not a view-level thing.

@christopherthielen
Copy link
Contributor

I believe the original reported issue is "not a bug" since resolve: {} is not supported on views; it is only supported on states definitions.

Please open a new issue if there is something else going on here, as @cah-ricksuggs suggests.

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

No branches or pull requests

4 participants