AngularJS, resolve and unknown provider

前端 未结 3 1366
悲哀的现实
悲哀的现实 2020-12-02 20:10

I\'ve two routes with resolve. Goes like this:

.when(\'/foos\', {
templateUrl: \'views/foos.html\',
controller: \'FoosCtrl\',
resolve: {
    foo_list: [\'$q\         


        
3条回答
  •  长情又很酷
    2020-12-02 20:30

    Just as a heads up, I just had a similar issue which was caused by adding the resolve-variables as a dependency to the controller while not having set up the response funciton in the $stateProvider.state() yet.

    Adding the resolve function fixed the missing dependency
    (I still don't quite get why - I'd be glad if anyone could share his knowledge in the comments)

提交回复
热议问题