小编seb*_*der的帖子

如何在 Angular 7 中将无限滚动与 mat-table 和服务结合使用?

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)

angular angular7

5
推荐指数
2
解决办法
1万
查看次数

如何覆盖 Bootstrap 中主按钮的样式

如果我单击单选按钮,我想更改背景颜色。

.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)

悬停效果有效,但活动效果无效

html css bootstrap-4 angular angular6

0
推荐指数
1
解决办法
4637
查看次数

标签 统计

angular ×2

angular6 ×1

angular7 ×1

bootstrap-4 ×1

css ×1

html ×1