How to directly access module’s constant in HTML on AngularJS

IMHO the better way to do this is use the $rootScope
In html every scope inherits from the $rootScope, so if a variable isn’t present in the current scope angular use the one declared in $rootScope.

A good way is to initialize this in the run “phase”

angular.module('myApp')
  .run(function ($rootScope) {
      $rootScope.ROUTES = ROUTES
   });

 

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)