<div class="main-div">
<mat-card class="main" *ngFor="let topics of topics">
<mat-card-content>
<div class="row">
<div class="column left">
<img class="responsive" src="https://newworldhub.com/api/assets/{{topics.profilePicture}}">
<p>{{topics.name}}</p>
<p>Posted {{Math.round(topics.dateDiff/1440)}}</p>
</div>
<div class="column middle text-in-tile">
<h1 routerLink="{{topics.topicId}}"
(click)="this.forumService.setPostToken(topics.topicId)">{{topics.topicSubject}}</h1>
<p class="content">{{topics.topicContent}}</p>
</div>
</div>
</mat-card-content>
</mat-card>
<mat-paginator [length]="100"
[pageSize]="1"
[pageSizeOptions]="[1, 10, 25, 100]">
</mat-paginator>
</div>
html^^
export class TopicsComponent implements OnInit {
form: FormGroup;
topics: Topics[];
Math: Math = Math;
constructor(
public forumService: ForumService,
public dataService: DataserviceService,
public metaService: Meta,
public titleService: Title) {
}
ngOnInit() {
this.forumService.getTopics().subscribe((topics: Topics[]) => {
this.topics = topics;
console.log(this.topics);
});
this.titleService.setTitle("Forum | New World Hub");
this.metaService.updateTag({ name: 'description', content: 'Guides for every aspect of Amazons game New World'});
}
}
我很好奇如何通过设置论坛主题的方式来实现分页。我在这里找到了几种不同的方法,但它们都不适合我当前存储数据的方式。
ITMISS
相关分类