AngularJS Create your first constant


Example

angular
  .module('MyApp', [])
  .constant('VERSION', 1.0);

Your constant is now declared and can be injected in a controller, a service, a factory, a provider, and even in a config method:

angular
  .module('MyApp')
  .controller('FooterController', function(VERSION) {
    this.version = VERSION;
  });
<footer ng-controller="FooterController as Footer">{{ Footer.version }}</footer>