I have a variable that is defined globally, and I need it in an angular expression.
I tried using the $window
service but it doesn't seem to work:
JS
var INCLUDE_FILENAME = 'includeme.html';
HTML
{{$window.INCLUDE_FILENAME}}
<div data-ng-include="$window.INCLUDE_FILENAME"></div>
Above code available as a plunkr
I know that I could use a controller storing data from $window
as a scope variable, but that's rather useless as I could just access it without the angular service in that case.