-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the user group component #406
- Loading branch information
Omnia Kahla
authored and
Omnia Kahla
committed
Sep 2, 2020
1 parent
8c5e7aa
commit 6cceaab
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
user-group works! | ||
</p> |
Empty file.
32 changes: 32 additions & 0 deletions
32
src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
); | ||
} | ||
|
||
} |