私はスレッドの後に関数を呼び出そうとしています。しかし、関数は スレッドを完了する前に呼び出されます。どこを変更する必要がありますか?
this._listService.getListById(this.userName)
.subscribe((response: any) => { // getting proper response.
if (response) {
this._listServiceMod.loadListModel(response); // thread
this.filterList();
}
});
loadListModel(data:any) {
const promise = this._listItemService.run(
this.loadListItem,
{
constants: appConstants
});
promise.then((updatedAuthList) => {
....
....
this._listItemService.terminate(promise);
}).catch(e => {
});;
}
filterList(){
console.log('Inside Filter List') // prints before completing thread.
}