first component.ts <button class="btn btn-success" (click)="getReferenceDataForEmp()">ReferenceFile</button> getReferenceDataForEmp() { console.log('Reference fire'); this.router.navigate(['References']); } second component.ts ngOnInit() { console.log('welcome'); this.apiservice.getReferenceDataForEmployee('Employees') .subscribe( data=>{ this.RefListVal = data; //SUBSCRIBE HERE console.log(this.RefListVal); }); on API service function getreferenceDataForEmployee getReferenceDataForEmployee(tablename : string):Observable<referencecolumns[]> { return this.http.get<referencecolumns[]>('https://localhost:44326/api/Reference/'+ tablename); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)