1 import { Component, OnInit } from '@angular/core'
3 import { NotificationsService } from 'angular2-notifications'
4 import { SortMeta } from 'primeng/primeng'
5 import { ActorFollow } from '../../../../../../shared/models/actors/follow.model'
6 import { RestPagination, RestTable } from '../../../shared'
7 import { FollowService } from '../shared'
8 import { I18n } from '@ngx-translate/i18n-polyfill'
11 selector: 'my-followers-list',
12 templateUrl: './followers-list.component.html',
13 styleUrls: [ './followers-list.component.scss' ]
15 export class FollowersListComponent extends RestTable implements OnInit {
16 followers: ActorFollow[] = []
19 sort: SortMeta = { field: 'createdAt', order: 1 }
20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
23 private notificationsService: NotificationsService,
24 private followService: FollowService,
34 protected loadData () {
35 this.followService.getFollowers(this.pagination, this.sort)
38 this.followers = resultList.data
39 this.totalRecords = resultList.total
42 err => this.notificationsService.error(this.i18n('Error'), err.message)