import { ChangeDetectionStrategy , Component } from '@angular/core' ; import { ChannelsV2Service } from '../channels-v2.service' ; import { PostMenuService } from '../../../../common/components/post-menu/post-menu.service' ; import { ActivityService } from '../../../../common/services/activity.service' ; /**
 * Subscribe button (non-owner)
 */ @ Component ( { selector : 'm-channelActions__subscribe' , changeDetection : ChangeDetectionStrategy . OnPush , templateUrl : 'subscribe.component.html' , providers : [ PostMenuService , ActivityService ] , } ) export class ChannelActionsSubscribeComponent { param service param postMenu param activity constructor ( public service , protected postMenu , activity ) { } todo async subscribe ( ) { const user = { ... this . service . channel$ . getValue ( ) } ; this . service . setChannel ( { ... user , subscribed : true } ) ; await this . postMenu . setEntityOwner ( user ) . subscribe ( ) ; this . service . setChannel ( { ... user } ) ; } }