我已在在app.js角 - 在多個文件中定義模塊
config = angular.module('config', [])
.constant('Constants', {
Car: 'BMW',
Phone: 'G4'
});
services = angular.module('services', ['config']);
controllers = angular.module('controllers', ['config', 'services']);
app = angular.module('myApp', ['config', 'controllers']);
我想將「配置」模塊定義移動到一個單獨的文件,因爲我希望它做大以下。
是否有可能下面的部分轉移到一個單獨的文件:
config = angular.module('config', [])
.constant('Constants', {
Car: 'BMW',
Phone: 'G4'
});
你不能改變的常數值之前加載.... –
可以有無數files..not清楚確切的問題是什麼,或者什麼你在問。但是,應該將模塊分組爲功能而不是組件 – charlietfl
爲了清晰起見,我編輯了該問題。 –