SS
Size: a a a
SS
LI
RV
LI
M
LI
LI
M
RV
LI
LI
RV
LI
LI
RV
SS
LI
LI
export class ChannelAnalysisComponent {
public readonly currentChannel$ = this.currentChannel.channel$;
public readonly nowBeingComparedChannels$ = this.compareMenuForm.nowBeingCompared$;
public constructor(
private readonly currentChannel: CurrentUsingChannelByQueryService,
private readonly compareMenuForm: CompareMenuFormService
) {}
}
LI
@Injectable()
export class CompareMenuFormService {
public get nowBeingCompared$(): Observable<UsingChannel[]> {
return this.nowBeingComparedMulticast$;
}
public readonly form: { [index: number]: UsingChannel|undefined } = {}
private readonly nowBeingComparedMulticast$ = new ReplaySubject<UsingChannel[]>();
public selectChannel(channel: UsingChannel): void {
this.form[channel.index] = channel;
this.emitNowBeingCompared();
}
public unSelectChannel(channel: UsingChannel): void {
this.form[channel.index] = undefined;
this.emitNowBeingCompared();
}
private emitNowBeingCompared(): void {
const beingCompared = Object.values(this.form).filter(value => value !== undefined) as UsingChannel[];
this.nowBeingComparedMulticast$.next(beingCompared);
}
}
LI