next-ucap-messenger/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts

29 lines
757 B
TypeScript
Raw Normal View History

import { Component, OnInit } from '@angular/core';
2019-09-25 08:26:19 +00:00
import { Observable } from 'rxjs';
import { Store, select } from '@ngrx/store';
import { ucapAnimations } from '@ucap-webmessenger/ui';
2019-09-25 09:08:50 +00:00
import { UserInfo, GroupDetailData } from '@ucap-webmessenger/protocol-sync';
2019-09-25 08:26:19 +00:00
import * as AppStore from '@app/store';
@Component({
selector: 'app-layout-chat-left-sidenav-group',
templateUrl: './group.component.html',
styleUrls: ['./group.component.scss'],
animations: ucapAnimations
})
export class GroupComponent implements OnInit {
2019-09-25 09:08:50 +00:00
groupList$: Observable<GroupDetailData[]>;
2019-09-25 08:26:19 +00:00
constructor(private store: Store<any>) {}
2019-09-25 08:26:19 +00:00
ngOnInit() {
2019-09-25 09:08:50 +00:00
this.groupList$ = this.store.pipe(
select(AppStore.MessengerSelector.SyncSelector.groupList)
2019-09-25 08:26:19 +00:00
);
}
}