0
You can see that back-end paging is working.
My goal is to achieve returns the first three records of the first tab in Angular as shown in Postman, if I manage to complete this first step of implementation I will be able to do the rest.
That was my attempt;
Service class;
getMenuPage(skip, limit): Observable<any>{
return this._http.get(`${this.url}/menuspage?page=${skip}&size=${limit}`)
.map(res => res.json());
}
And that’s 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?
seems to have a typo in your url tries:
${this.url}/menuspage?skip=${skip}&limit=${limit}
– Eduardo Vargas
That’s right @Eduardovargas, thank you very much
– wladyband
You can put your answer, thank you very much.
– wladyband