I have a module with a constant like this:
angular.module('SampleMod',[])
.constant("VERSION", "2.1");
I want to show the constant value in HTML with something like this:
<p>{{VERSION}}</p>
Is it possible (without passing by the controller)?
You can use
$rootScope
for this, but you would have to assign the value to$rootScope
at some point. You could also use a directive that does essentially the same thing.