Вы видите, что у меня есть метод, который работает нормально, как я ожидал
loadTemplates(configUrl: any, templateId: string): Observable<any> {
this.getConfiguration(configUrl)
.pipe(
concatMap(configResponse =>
this.getTemplate(
CONFIGURATION_URL +
"templates/" +
configResponse.TemplateSettings.RootTemplate.Path,
configResponse
)
),
concatMap(rootTemplate =>
this.templateEngine.getAllChildTemplates(rootTemplate)
),
concatMap(childTemplates=>this.templateEngine.createTemplateToRender(childTemplates,""))
)
.subscribe(finalresponse=> {
debugger;
});
}
}
Выполнение
- getTheConfiguration () => basedontheconfigresponse =>
- вызов getTemplate (basedontheconfigresponse) => basedntheTemplateresponse =>
- вызов getAllChildTemplates (basedntheTemplateresponse) => basedonthechildtemplateresponse =>
- вызов createTemplate (basedonthe)
в 4-й маркерной точке я передаю пустой параметр методу createTemplate , на самом деле мне нужно передать basedntheTemplateresponse (в коде rootTemplate ),Прямо сейчас я делаю твик, настраивая при выполнении getAllChildTemplates
getAllChildTemplates(parentTemplate: string) {
this.currentrootTemplate = parentTemplate;
var services = this.getChildTemplateServiceInstance(parentTemplate);
return forkJoin(services);
}
, есть ли какой-нибудь правильный способ передать rootTemplate от самого канала к следующему concatMap ?Я не уверен, что это правильный подход.