pro.component.ts
this.vList.forEach((v: any) => {
v.Completed ? this.trainCom++ : this.trainpen++;
v.isQCompleted ? this.qCount++ : this.qPen++;
});
});
this.vList.forEach((v: any) => {
if(!v.Completed) {
this.pen_cour.push(v.name);
} else {
this.com_cour.push(v.name);
}
if(!v.isQCompleted) {
this.pen_cour_q.push(v.name);
} else {
this.com_cour_q.push(v.name);
}
});
});
cour_Com(){
this.com_cour.forEach(element => {
this.cour1 =this.com_cour;
console.log("hello");
console.log(this.cour1);
});
}
pro.component.html
<button type="button" class="btn btn-primary" (click)="cour_Comp()" >View</button>
<div id="demo" *ngFor='let cour of this.com_cour'>
<span *ngIf="this.com_cour != NULL"><button type="button" class="btn btn-primary" ng-show="this.com_cour != NULL">{{course}}</button></span>
</div>