Here shows the project done in angular2 framework with loopback. I want to use promise along with data retrieved using loopback.
data.component.ts
ngOnInit () {
this.dataService.getAllData()
.then(response => {this.data.push(response);});
}
data.service.ts
public getAllData(): any {
this.my_model.find()
.toPromise()
.then((res : Response) => res);
}
I want to interpolate this data to the html view. How to do this?