Tutorial by Examples

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 = V...
There is no revolution here, but angular constant can be useful specially when your application and/or team starts to grow ... or if you simply love writing beautiful code! Refactor code. Example with event's names. If you use a lot of events in your application, you have event's names a lit...

Page 1 of 1