Injecting Dependencies in config() modules - AngularJS

前端 未结 4 2031
面向向阳花
面向向阳花 2020-11-29 18:45

Currently in app.js i have the following routes:

var gm = angular.module(\'gm\', [\'gm.services\',\'gm.directives\',\'gm.filters\',\'gm.controllers\',\'ngSan         


        
4条回答
  •  迷失自我
    2020-11-29 19:00

    You should use constant for that, because it's the only thing you can inject in the config phase other than providers.

    angular.module("yourModule").constant("paths", {
      base: function(){ ... }
    });
    

提交回复
热议问题