Here's the code that I have:
resolve: {
get: ['setTest', 'questionService', 'testService', '$stateParams',
(setTest, qus: IQuestionService, tes: ITestService, $stateParams) => {
if (tes.qs) {
qus.mapUserTestQuestions(tes.qs);
return true;
} else {
var userTestId = parseInt($stateParams.testId.substring(6, 11));
return qus.getUserTestQuestions(userTestId);
}
}]
},
The problem is that I get a message saying "No common return type" which I guess is because one part of the if returns true and the other a promise.