import { ChangeDetectionStrategy , Component , Input } from '@angular/core' ; import { FeaturesService } from '../../../../services/features.service' ; import { MindsUser } from '../../../../interfaces/entities' ; import { ChannelEditService } from './edit.service' ; /**
 * Edit modal component
 */ @ Component ( { selector : 'm-channel__edit' , changeDetection : ChangeDetectionStrategy . OnPush , templateUrl : 'edit.component.html' , providers : [ ChannelEditService ] , } ) export class ChannelEditComponent { param channel @ Input ( 'channel' ) set data ( channel ) { this . service . setChannel ( channel ) ; } param onSave param onDismissIntent set opts ( { onSave , onDismissIntent } ) { this . onSave = onSave || ( ( ) => { } ) ; this . onDismissIntent = onDismissIntent || ( ( ) => { } ) ; } /**
     * Modal save handler
     */ onSave : ( any ) => any = ( ) => { } ; /**
     * Modal dismiss intent handler
     */ onDismissIntent : ( ) => void = ( ) => { } ; param service param features constructor ( public service , protected features ) { } param channel getProSettingsRouterLink ( channel ) { if ( ! channel ) { return [ ] ; } return [ '/settings/pro_canary' , channel . username ] ; } /**
     * Saves the updated user info
     */ async onSubmit ( ) { const channel = await this . service . save ( ) ; if ( channel ) { this . onSave ( channel ) ; } } }