Access AngularJS constant in a view
Is not possible. You need to inject Urls
in the controller $scope
(or parent using $parent
) because {{ var }}
is interpolated to $scope.var
Does not have any performance problem if you inject Urls
in your controller and write $scope.Urls = Urls
Example:
angular.module('myapp').controller('myController', ($scope, Urls) { $scope.Urls = Urls;}