我infinite-scroll在我的mat-table. 我table.service.ts从后端获取类的数据。如何在电子表格中使用无限滚动功能,以便在向下滚动时自动显示越来越多的内容。
窗口 - Angular 7。我使用材料表。
liste.component.ts
private load() {
const liste_sub = this.liste_Service.loadListe('001', 0, LIST_SIZE).subscribe(
liste=> {
this.dataSource.data = liste;
},
(err: HttpErrorResponse) => {
// onError()-Rumpf
this.handleHttpError(err);
});
this.subscription.add(liste_sub);
}
Run Code Online (Sandbox Code Playgroud)
liste.service.ts
public loadListe(from: number, size: number): Observable<Liste[]> {
if (!this.cache$ || this.from_cashe$ !== from || this.size_cashe$ !== size) {
this.from_cashe$ = from;
this.size_cashe$ = size;
this.cache$ = this.doRequest(from, size).pipe(
shareReplay(CACHE_SIZE)
);
}
return this.cache$;
}
private doRequest(from: number, size: number): Observable<Liste[]> { …Run Code Online (Sandbox Code Playgroud) 如果我单击单选按钮,我想更改背景颜色。
.btn-primary:hover,
.btn-primary:active,
.btn-primary:visited,
.btn-primary:focus {
background-color: black !important;
color: white !important;
}
.btn-primary {
color: black;
background-color: white;
width: 100%;
}Run Code Online (Sandbox Code Playgroud)
<div class="btn-group">
<div class="radiobuttonWidth">
<p-radioButton [somethink]="some"> </p-radioButton>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
悬停效果有效,但活动效果无效