目前我的代碼看起來是這樣的:有沒有一種方法可以等待angular-ui-router解決方案中的多個promise的結果?
resolve: {
adminTestLevel: ['testService', (tes: ITestService) => {
return tes.getAdminTestLevel();
}],
adminTestStatus: ['testService', (tes: ITestService) => {
return tes.getAdminTestStatus();
}],
adminTestType: ['testService', (tes: ITestService) => {
return tes.getAdminTestType();
}],
adminTestGradeType: ['testService', (tes: ITestService) => {
return tes.getAdminTestGradeType()
}],
exams: ['testService', (tes: ITestService) => {
return tes.getExams();
}],
examTypes: ['testService', (tes: ITestService) => {
return tes.getExamTypes();
}],
testOrderBy: ['testService', (tes: ITestService) => {
return tes.getTestOrderBy();
}],
topics: ['testService', (tes: ITestService) => {
return tes.getTestsTopics();
}],
},
有沒有我可以簡化,這樣我就不必有ITestService這麼多的注射的方法嗎?此外,我不需要有所有不同的決議,如果可能的話,我想將它們合併爲一個。