content projection is applied

This commit is contained in:
병준 박 2019-10-11 17:52:00 +09:00
parent e9088572d5
commit fee7aa70b0
4 changed files with 50 additions and 10 deletions

View File

@ -36,8 +36,17 @@
</mat-menu> </mat-menu>
</div> </div>
<div> <div>
<ucap-group-expansion-panel #groupExpansionPanel [groupBuddyList]="groupBuddyList$ | async" <ucap-group-expansion-panel
[favoritBuddyList]="favoritBuddyList$ | async" (selectBuddy)="onSelectBuddy($event)"> #groupExpansionPanel
[groupBuddyList]="groupBuddyList$ | async"
[favoritBuddyList]="favoritBuddyList$ | async"
>
<ucap-profile-user-list-item
*ucapGroupExpansionPanelItem="let userInfo"
[userInfo]="userInfo"
(click)="onSelectBuddy(userInfo)"
>
</ucap-profile-user-list-item>
</ucap-group-expansion-panel> </ucap-group-expansion-panel>
</div> </div>
</div> </div>

View File

@ -144,7 +144,8 @@ export class GroupComponent implements OnInit {
} }
onSelectBuddy(buddy: UserInfo) { onSelectBuddy(buddy: UserInfo) {
this.store.dispatch(ChatStore.selectedRoom({ roomSeq: String(buddy.seq) })); // this.store.dispatch(ChatStore.selectedRoom({ roomSeq: String(buddy.seq) }));
this.logger.debug('onSelectBuddy', buddy);
} }
onKeyDownEnterOrganizationTenantSearch(params: { onKeyDownEnterOrganizationTenantSearch(params: {

View File

@ -5,9 +5,20 @@
<mat-panel-description> </mat-panel-description> <mat-panel-description> </mat-panel-description>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ucap-profile-user-list-item *ngFor="let favUserList of favoritBuddyList" [userInfo]="favUserList" <ng-container *ngFor="let favUserList of favoritBuddyList">
(click)="onClickBuddy(favUserList)"> <ng-template
</ucap-profile-user-list-item> [ngTemplateOutlet]="expansionPanelItemTemplateRef"
[ngTemplateOutletContext]="{ $implicit: favUserList }"
>
</ng-template>
</ng-container>
<!-- <ucap-profile-user-list-item
*ngFor="let favUserList of favoritBuddyList"
[userInfo]="favUserList"
(click)="onClickBuddy(favUserList)"
>
</ucap-profile-user-list-item> -->
</mat-expansion-panel> </mat-expansion-panel>
<mat-expansion-panel *ngFor="let groupBuddy of groupBuddyList"> <mat-expansion-panel *ngFor="let groupBuddy of groupBuddyList">
@ -16,9 +27,19 @@
<mat-panel-description> </mat-panel-description> <mat-panel-description> </mat-panel-description>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ucap-profile-user-list-item *ngFor="let userInfo of groupBuddy.buddyList" [userInfo]="userInfo" <ng-container *ngFor="let userInfo of groupBuddy.buddyList">
(click)="onClickBuddy(userInfo)"> <ng-template
</ucap-profile-user-list-item> [ngTemplateOutlet]="expansionPanelItemTemplateRef"
[ngTemplateOutletContext]="{ $implicit: userInfo }"
></ng-template>
</ng-container>
<!-- <ucap-profile-user-list-item
*ngFor="let userInfo of groupBuddy.buddyList"
[userInfo]="userInfo"
(click)="onClickBuddy(userInfo)"
>
</ucap-profile-user-list-item> -->
<!-- <ucap-profile-user-list-item *ngFor="let userInfo of groupBuddy.buddyList" [userInfo]="userInfo" <!-- <ucap-profile-user-list-item *ngFor="let userInfo of groupBuddy.buddyList" [userInfo]="userInfo"
[presence]="presence"> [presence]="presence">
</ucap-profile-user-list-item> --> </ucap-profile-user-list-item> -->

View File

@ -4,13 +4,16 @@ import {
Input, Input,
Output, Output,
EventEmitter, EventEmitter,
ViewChild ViewChild,
ContentChild,
TemplateRef
} from '@angular/core'; } from '@angular/core';
import { ucapAnimations } from '@ucap-webmessenger/ui'; import { ucapAnimations } from '@ucap-webmessenger/ui';
import { GroupDetailData, UserInfo } from '@ucap-webmessenger/protocol-sync'; import { GroupDetailData, UserInfo } from '@ucap-webmessenger/protocol-sync';
import { MatAccordion } from '@angular/material'; import { MatAccordion } from '@angular/material';
import { ExpansionPanelItemDirective } from '../directives/expansion-panel-item.directive';
@Component({ @Component({
selector: 'ucap-group-expansion-panel', selector: 'ucap-group-expansion-panel',
@ -28,6 +31,12 @@ export class ExpansionPanelComponent implements OnInit {
@Output() @Output()
selectBuddy = new EventEmitter<UserInfo>(); selectBuddy = new EventEmitter<UserInfo>();
@ContentChild(ExpansionPanelItemDirective, {
read: TemplateRef,
static: true
})
expansionPanelItemTemplateRef: TemplateRef<ExpansionPanelItemDirective>;
@ViewChild('groupAccordion', { static: true }) groupAccordion: MatAccordion; @ViewChild('groupAccordion', { static: true }) groupAccordion: MatAccordion;
constructor() {} constructor() {}