aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/friends/friend-list/friend-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/friends/friend-list/friend-list.component.ts')
-rw-r--r--client/src/app/+admin/friends/friend-list/friend-list.component.ts15
1 files changed, 11 insertions, 4 deletions
diff --git a/client/src/app/+admin/friends/friend-list/friend-list.component.ts b/client/src/app/+admin/friends/friend-list/friend-list.component.ts
index bec10162c..700ea7a69 100644
--- a/client/src/app/+admin/friends/friend-list/friend-list.component.ts
+++ b/client/src/app/+admin/friends/friend-list/friend-list.component.ts
@@ -1,5 +1,7 @@
1import { Component, OnInit } from '@angular/core'; 1import { Component, OnInit } from '@angular/core';
2 2
3import { NotificationsService } from 'angular2-notifications';
4
3import { Friend, FriendService } from '../shared'; 5import { Friend, FriendService } from '../shared';
4 6
5@Component({ 7@Component({
@@ -10,7 +12,10 @@ import { Friend, FriendService } from '../shared';
10export class FriendListComponent implements OnInit { 12export class FriendListComponent implements OnInit {
11 friends: Friend[]; 13 friends: Friend[];
12 14
13 constructor(private friendService: FriendService) { } 15 constructor(
16 private notificationsService: NotificationsService,
17 private friendService: FriendService
18 ) { }
14 19
15 ngOnInit() { 20 ngOnInit() {
16 this.getFriends(); 21 this.getFriends();
@@ -21,10 +26,12 @@ export class FriendListComponent implements OnInit {
21 26
22 this.friendService.quitFriends().subscribe( 27 this.friendService.quitFriends().subscribe(
23 status => { 28 status => {
24 alert('Quit friends!'); 29 this.notificationsService.success('Sucess', 'Friends left!');
30
25 this.getFriends(); 31 this.getFriends();
26 }, 32 },
27 error => alert(error.text) 33
34 err => this.notificationsService.error('Error', err.text)
28 ); 35 );
29 } 36 }
30 37
@@ -32,7 +39,7 @@ export class FriendListComponent implements OnInit {
32 this.friendService.getFriends().subscribe( 39 this.friendService.getFriends().subscribe(
33 res => this.friends = res.friends, 40 res => this.friends = res.friends,
34 41
35 err => alert(err.text) 42 err => this.notificationsService.error('Error', err.text)
36 ); 43 );
37 } 44 }
38} 45}