0

hi I am trying to upgrade from 0.2.8 to 1.0.0-beta.1 on ui-router and run into this error in any state that uses the 'resolve' property. For example, I get 'Invalid resolve value: "q" errors from the state below

state('myState', {
                url: '/myState?filter',
                component: 'myComponent',
                resolve: ['$q', '$ocLazyLoad', function ($q, $ocLazyLoad) {
                    var deferred = $q.defer()
                      .....
                }]
            })

Can someone point me in the right direction for using 'resolve' in ui-router 1.0 ? The docs pretty much suck.

Thanks!

1 Answer 1

1

resolve is supposed (and has always supposed) to be an object, with functions as values. See the documentation:

An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved before the controller is instantiated. [...]

Sign up to request clarification or add additional context in comments.

1 Comment

thank you for the link. that helped. it's not clear in the docs that i was reading.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.