mat-pagination

Mat Paginator of Mat Tabledoesn't work with api data

时光毁灭记忆、已成空白 提交于 2021-01-29 08:01:04
问题 I've seen similar questions, but nothing seems to work for me. I have a mat table where I display data from an api. But I don't know how to iterate through the 'dataSource'. Below is my code, and how I get the data when I check console log. ts file import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; import {Pokemon, PokemonData} from '../../models/pokemon'; import {PokemonService} from '../../models/services/pokemon.service'; import {ActivatedRoute} from '@angular

Mat paginator items per page not working in angular 9

大城市里の小女人 提交于 2020-12-27 04:45:02
问题 I'm rendering the table data from an observable and then assigning the datasource to the paginator. The next page arrows are working, as well as the first page and last page buttons. When I'm trying to change the items per page, it is not working. I tried ngAfterViewInit and page event calling and they did'nt make any difference. import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core'; import { DataserviceService } from 'src/app/dataservice.service'; import { DataProvider

Mat paginator items per page not working in angular 9

拥有回忆 提交于 2020-12-27 04:43:59
问题 I'm rendering the table data from an observable and then assigning the datasource to the paginator. The next page arrows are working, as well as the first page and last page buttons. When I'm trying to change the items per page, it is not working. I tried ngAfterViewInit and page event calling and they did'nt make any difference. import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core'; import { DataserviceService } from 'src/app/dataservice.service'; import { DataProvider