title: Global Settings in AngularJS
body: <p>I have an app that have to be <em>customisable</em> and one parameter is the root of the url. The app ain't necessarily at the root of the website, ie. it can be hosted at <a href="http://onedomain.com/index.html" rel="noreferrer">http://onedomain.com/index.html</a>, where the <code>appName</code> would be <code>/</code>, as it can be hosted at <a href="http://anotherdomain.com/myapp/index.html" rel="noreferrer">http://anotherdomain.com/myapp/index.html</a>, where the <code>appName</code> would be <code>/myapp/</code>.</p>
  
  <p>But I need to know the <code>appName</code> in the router, so in the <code>configFn</code> of my module, to do this kind of stuff:</p>
  
  <pre><code>return $routeProvider.when(appName + "index.html", {
    templateUrl: 'views/main.html',
    controller: 'MainCtrl'
  })
  </code></pre>
  
  <p>As I have more parameters, I started a service I called <code>Settings</code> but you can't inject services while configuring a module…</p>
  
  <p>What would you do?</p>
  
  <p>For my concern, I started thinking about a custom provider but I'm not sure it's appropriate.</p>