Skip to content

Commit

Permalink
Adding the user group component #406
Browse files Browse the repository at this point in the history
  • Loading branch information
Omnia Kahla authored and Omnia Kahla committed Sep 2, 2020
1 parent 8c5e7aa commit 6cceaab
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>
user-group works!
</p>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Component, OnInit } from '@angular/core';
import {UsergroupService} from '../../../mongodb/usergroup/usergroup.service';

@Component({
selector: 'app-user-group',
templateUrl: './user-group.component.html',
styleUrls: ['./user-group.component.scss']
})
export class UserGroupComponent implements OnInit {
userID: string;
userGroups: Array<any> = [];
constructor(
private usergroupService: UsergroupService,
) { }

ngOnInit() {
this.userID = localStorage.getItem('userId');

}
getUserGroups() {
console.log('get user groups');
this.usergroupService.getAllUserGroups()
.subscribe(
usergroupresponse => {
console.log(usergroupresponse);
this.userGroups = (usergroupresponse as any).body.groups;
},
error => console.log(error)
);
}

}

0 comments on commit 6cceaab

Please sign in to comment.