-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathperson-list.component.ts
More file actions
40 lines (33 loc) · 953 Bytes
/
person-list.component.ts
File metadata and controls
40 lines (33 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import {Component} from "@angular/core";
import {ContactService} from "../services/contact.service";
@Component({
selector: 'personList',
template: `<div class="col-md-12">
<div class="row"
infinite-scroll
[infiniteScrollDistance]="2"
[immediateCheck]="false"
[infiniteScrollThrottle]="100"
(scrolled)="loadMore()" >
<ccCard *ngFor="let person of contacts.persons"
[user]="person">
</ccCard>
</div>
<div *ngIf="contacts.persons.length == 0 && !contacts.isLoading">
<div class="alert alert-info">
<p class="text-center">No results found for search term '{{ contacts.search }}'</p>
</div>
</div>
<ccSpinner [isLoading]="contacts.isLoading"
[message]="'Loading...'"></ccSpinner>
</div>
`
})
export class PersonListComponent {
constructor(public contacts: ContactService) {
}
loadMore() {
console.log("loadMore");
this.contacts.loadMore();
}
}