Angularjs ng-controller with resolve

前端 未结 8 548
时光取名叫无心
时光取名叫无心 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:21

    'data' from route resolve will not be available for injection to a controller activated other than route provider. it will be available only to the view configured in the route provider.

    if you want the data to the controller activated directly other than routeprovider activation, you need to put a hack for it.

    see if this link helps for it:

    http://www.johnpapa.net/route-resolve-and-controller-activate-in-angularjs/

提交回复
热议问题