title: Angular.js: Is .value() the proper way to set app wide constant and how to retrieve it in a controller
body: <p>Hi there I was watching a couple of the angular.js videos and saw that the value() method was used to set a kind of module-wide constant. for example, one can set the Angular-UI library's config like so: (coffeescript)</p>
  
  <pre><code>angular.module('app',[])
  .value "ui.config", 
    tinymce:
      theme: 'simple'
      width: '500'
      height: '300'
  </code></pre>
  
  <p>And my app is currently looking like this:</p>
  
  <pre><code>window.app = angular.module("app", [ 'ui'])
  
  .config(["$routeProvider", ($routeProvider) -&gt;
    $routeProvider
    .when "/users",
      templateUrl: "assets/templates/users/index.html"
      controller: IndexUsersCtrl
  
    .otherwise redirectTo: "/users"
  
  ])
  
  .value 'csrf', $('meta[name="csrf-token"]').attr('content') #&lt;---- attention here
  
  IndexUsersCtrl = ($scope) -&gt;
    $scope.users = gon.rabl
    console.log "I want to log the csrf value here" #&lt;---- then attention
  IndexUsersCtrl.$inject = ['$scope']
  </code></pre>
  
  <p>But I can't seem to get that value by tapping into the 'app' variable which is corresponding to the app module. </p>
  
  <p>I read up here on ST and over on angularjs's google group that one way to share common code btwn controllers is through a service, will this concept apply here, too?</p>
  
  <p>Thanks!</p>