You may notice that paging back-end is working.
My goal is to get the first three records of the first tab in the Angular as it shows in Postman, if I can finish this first step of the implementation I will be able to do the rest.
This was my attempt;
Class of service;
getMenuPage(skip, limit): Observable<any>{
return this._http.get('${this.url}/menuspage?page=${skip}&size=${limit}')
.map(res => res.json());
}
And this is my component class;
public title: string;
public menu: Menu[];
constructor(
private _menuService: MenuAdminService
) {
this.title = 'Lista de Cardápios';
}
ngOnInit() {
this.getMenusPage(0,4);
}
getMenusPage(skip, limit) {
this._menuService.getMenuPage(skip, limit).subscribe(
response => {
console.log(response.data)
if (!response.data) {
} else {
this.menu = response.data;
}
},
error => {
console.log(<any>error);
}
);
}
The return of my browser consoles is this:
Array(0)length: 0__proto__: Array(0)
How do I fix this implementation?