5

Possible Duplicate:
AngularJS dependency injection of value inside of module.config

I am having trouble getting the value() injected into the app.config(). Here's the code (coffeescript)

window.app = angular.module("app", [])

app.value("template_path", "assets/angular/templates/users")

app.config(["$routeProvider","template_path" ($routeProvider, template_path) ->
  console.log template_path

it is throwing an "Unknown provider: template_path from app" error

Could it be that the config() method cannot be injected with value() set values? I am using 1.0.2

Community
  • 1
  • 1
Nik So
  • 16,683
  • 21
  • 74
  • 108
  • This is essentially the same question as http://stackoverflow.com/questions/12903338/angularjs-dependency-injection-of-value-inside-of-module-config/ – pkozlowski.opensource Oct 23 '12 at 17:26
  • I see, I need to work on my ST search-fu :) Could some moderator close this for duplication then? – Nik So Oct 23 '12 at 18:17

1 Answers1

18

Yes, you were suspecting correctly: values can't be injected into the config block. The config block can only have constants and providers injected.

pkozlowski.opensource
  • 117,202
  • 60
  • 326
  • 286