ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
30 lines (24 loc) • 937 B
text/typescript
import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core';
import { Subscription } from 'rxjs';
import { ReuseTcomponentsontextService } from './reuse-tab-context.service';
import { ReuseContextCloseEvent, ReuseContextI18n } from './reuse-tab.interfaces';
({
selector: 'reuse-tab-context',
template: ``,
})
export class ReuseTcomponentsontextComponent implements OnDestroy {
private sub$: Subscription = new Subscription();
()
set i18n(value: ReuseContextI18n) {
this.srv.i18n = value;
}
// tslint:disable-next-line:no-output-native
() readonly change = new EventEmitter<ReuseContextCloseEvent>();
constructor(private srv: ReuseTcomponentsontextService) {
this.sub$.add(srv.show.subscribe(context => this.srv.open(context)));
this.sub$.add(srv.close.subscribe(res => this.change.emit(res)));
}
ngOnDestroy(): void {
this.sub$.unsubscribe();
}
}