diff --git a/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.html b/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.html new file mode 100644 index 00000000..6cab62e3 --- /dev/null +++ b/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.html @@ -0,0 +1,3 @@ +

+ user-group works! +

diff --git a/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.scss b/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.ts b/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.ts new file mode 100644 index 00000000..a854ba79 --- /dev/null +++ b/src/app/user-action-engine/dashboard/dashboard/user-group/user-group.component.ts @@ -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 = []; + 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) + ); + } + +}