Download angularjs eBook


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

Related Examples


66 Contributors: 1
Tuesday, July 26, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial:

Download eBook