import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute , Route , Router } from "@angular/router" ; import { UtilsService } from "../../services/utils.service" ; import { GroupService } from "../../services/groups/group.service" ; import { TableHeader } from "../../models/table-header.model" ; import { ContextService } from "../../services/context.service" ; import { UsersUtilsService } from "../../services/users/users-utils.service" ; @ Component ( { selector : 'app-all-groups' , templateUrl : './all-groups.component.html' , styleUrls : [ './all-groups.component.scss' ] } ) export class AllGroupsComponent implements OnInit { public groups ; public user ; public showModal = false ; public tableConfig ; constructor ( private activatedRoute , private router , private context , private groupService , private usersUtils , private utils ) { this . user = this . context . user ; this . groups = this . activatedRoute . snapshot . data [ 'groups' ] ; this . tableConfig = { selectable : false , rowClickable : true , headers : [ new TableHeader ( 'Name' , 'name' , 'string' ) , new TableHeader ( 'Owners' , 'owners' , 'function' , ( element ) => { return this . usersUtils . displayOwners ( element , this . user ) ; } ) , new TableHeader ( 'Members' , 'members' , 'count' ) , ] } ; } ngOnInit ( ) { } memberLink ( group ) { this . router . navigate ( [ 'base/home/all-groups-section/members' , group . id ] ) ; } }