1 import { Component, OnInit } from '@angular/core'
3 import { NotificationsService } from 'angular2-notifications'
4 import { SortMeta } from 'primeng/primeng'
5 import { AccountFollow } from '../../../../../../shared/models/actors/follow.model'
6 import { RestPagination, RestTable } from '../../../shared'
7 import { FollowService } from '../shared'
10 selector: 'my-followers-list',
11 templateUrl: './followers-list.component.html',
12 styleUrls: [ './followers-list.component.scss' ]
14 export class FollowersListComponent extends RestTable implements OnInit {
15 followers: AccountFollow[] = []
18 sort: SortMeta = { field: 'createdAt', order: 1 }
19 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
22 private notificationsService: NotificationsService,
23 private followService: FollowService
32 protected loadData () {
33 this.followService.getFollowers(this.pagination, this.sort)
36 this.followers = resultList.data
37 this.totalRecords = resultList.total
40 err => this.notificationsService.error('Error', err.message)