I have been redirected to another page like this
this.router.navigate(['prob/telecomnewdeal'], { queryParams:{ 'companyId': this.selectedCompnay, 'domainId':this.domainId } });
on new page
ngOnInit
i am getting params like this
ngOnInit(): void {
this.route.queryParams.subscribe(params => {
this.companyId = +params['companyId'];
this.domainId = +params['domainId'];
});
and then i am calling a API in ngOint like this
this.telecomDealService.addNewDeal(this.userEmail, false, this.companyId, this.domainId).subscribe((data: TelecomDealList) => {
this.dealQuestionsList = data.AssginedTowers[0].Questions;
let test = this.dealQuestionsList[0].IsHeader
this.addloadded = true;
console.log(this.addloadded);
for (var i = 0; i < data.AssginedTowers[0].Questions.length; i++) {
if (data.AssginedTowers[0].Questions[i].listAnswerOptions != null) {
this.drpoption = data.AssginedTowers[0].Questions[i].listAnswerOptions;
this.dealQuestionsList[i].listAnswerOptions = [];
for (var j = 0; j < Object.entries(this.drpoption).length; j++) {
let tempfilter: Item;
tempfilter = {
text: Object.entries(this.drpoption)[0][0],
value: Object.entries(this.drpoption)[0][0]
};
this.dealQuestionsList[i].listAnswerOptions.push(tempfilter);
}
}
}
this.spinner.hide();
});
but my HTML loads the data before i am getting data from my API
how to load the HTML after getting the data from API
What I have tried:
not able to understand the concept