AngularJS Constants


UPPERCASE your constant: Writing constant in capital is a common best practice used in many languages. It's also useful to clearly identify the nature of injected elements:

When you see .controller('MyController', function($scope, Profile, EVENT)), you instantly know that:

  • $scope is an angular element
  • Profile is a custom Service or Factory
  • EVENT is an angular constant