Skip to content

Unable to inject templateProvider with resolved values  #330

@sqs

Description

@sqs

A view's templateProvider is unable to be injected with resolved values. The following will fail with an error like Error: [$injector:unpr] Unknown provider: barProvider <- bar.

$stateProvider.state('foo', {
  resolve: {bar: function() { return 123; }},
  views: {
    foo: {
      templateProvider: function(bar) { /* ... */ },
    }
  },
})

I see in resolveState that $view.load only gets some locals to inject. Is there any technical reason why templateProvider couldn't be injected with all of the resolve values in the same way that controller is?

(This is on git master, and I remember seeing the same limitation a couple of months ago.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions