Angularjs ng-controller with resolve

前端 未结 8 700
时光取名叫无心
时光取名叫无心 2021-02-01 20:30

I\'ve ran into problem with ng-controller and \'resolve\' functionality:

I have a controller that requires some dependency to be resolved before running, it works fine w

8条回答
  •  别跟我提以往
    2021-02-01 21:03

    Getting data in "resolve" attribute is the functionality of route (routeProvider) , not the functionality of controller.

    Key( is your case : 'data') in resolve attribute is injected as service. That's why we are able fetch data from that service.

    But to use same controller in different place , you have fetch data in controller.

提交回复
热议问题