import { Component, OnInit } from '@angular/core'; import { GroupService } from '../../group/group.service'; import { Observable } from 'rxjs/Observable'; import { Group } from '../../group/group.model'; import { Router } from '@angular/router'; @Component({ selector: 'civ-app-admin-page', template: ` `, styles: [] }) export class GroupsEditPageComponent implements OnInit { groups$: Observable; constructor(private groupSvc: GroupService, private router: Router) { this.groupSvc.loadAllGroups(); this.groups$ = this.groupSvc.getAllGroups(); } ngOnInit() { } editGroup(id: string) { this.router.navigate([ '/group', id, 'admin' ]); } }