我正在開發一個模塊化角度應用程序,我在angular-module-1模塊中定義了我的文件夾路徑(常量:BASE_PATH:「path/to/folder」)。我想在我的應用程序的另一個模塊(angular-module-2)中的角度組件中重新使用此常量。我想在我的項目中多次使用這個常量。角度組件相對模板UIr
module.component("relationshipSearch", {
templateUrl: BASE_PATH +'/link/to/other/folder',
女巫來定義這個常量作爲一個全局變量中的所有解決方案項目 可見的最好辦法這裏是我的項目結構:
project
|-- angular-module-1
| |-- angular-module-1.js
| |-- angular-module-1.html
|-- angular-module-2
| |-- angular-module-2.js
| |-- angular-module-2.html
謝謝,我需要:) – Saad