Last post May 23, 2020 11:54 PM by ahmedbarbary
Member
39 Points
361 Posts
May 23, 2020 11:54 PM|ahmedbarbary|LINK
I work on angular 7 app I face issue I need to check if Reportid exist or not on Report Control object using *ngIf on component.html.
on code below report.component.ts I get Reportid from URL passed to report component .
and after that passed to GetReportControl function to return object of Reportid in case of Exist .
on report.component.ts
displayreport:any={}; Reportid: string; ngOnInit() { const paramIndex = window.location.href.indexOf('id='); if (paramIndex > 0) { let param = window.location.href.substring(paramIndex); let param1 = param.split('&')[0]; let param2 = param.substr(param.indexOf('=') + 1); this.Reportid=param2; } } this._displayreport.GetReportControl(Reportid).subscribe((res: any) => { this.ReportControl = res; console.log("report control is" + JSON.stringify(this.ReportControl) ); });
this.ReportControl return only one object as :
{"reportid":"2040","reportName":"financialAsset","reportType":"1"}
on report.component.html
How to check if ReportControl Have Reportid or not ?
I need to check ReportControl have value of reportid on report.component.html so what I do ?
Member
39 Points
361 Posts
How to check Reportid exist on ReportControl object or not using *ngif?
May 23, 2020 11:54 PM|ahmedbarbary|LINK
I work on angular 7 app I face issue I need to check if Reportid exist or not on Report Control object using *ngIf on component.html.
on code below report.component.ts I get Reportid from URL passed to report component .
and after that passed to GetReportControl function to return object of Reportid in case of Exist .
on report.component.ts
this.ReportControl return only one object as :
on report.component.html
How to check if ReportControl Have Reportid or not ?
I need to check ReportControl have value of reportid on report.component.html so what I do ?