Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular.js: value() not injected in config() [duplicate]

Tags:

angularjs

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

like image 233
Nik So Avatar asked Oct 23 '12 16:10

Nik So


1 Answers

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

like image 101
pkozlowski.opensource Avatar answered Oct 28 '22 23:10

pkozlowski.opensource