I am creating component for matDialog.
this.matDialog.open(SegmentDialogComponent, { data: segment }})
.afterClosed()
.pipe(
take(1),
filter((i: any) => i)
).subscribe((i: CLASS) => this.update.emit(i) );
How I can provide service (that would implement ITableSegmentService interface) that SegmentDialogComponent can use
export interface ITableSegmentService {
addSegment<T>(body: T): Observable<T>;
removeSegment(id: string): Observable<void>
}
.
@Component({
selector: 'segment-dialog',
templateUrl: './segment-dialog.component.html',
styleUrls: ['./segment-dialog.component.scss']
})
export class SegmentDialogComponent {
constructor(@Inject(MAT_DIALOG_DATA) public tableSegment: TableSegment) { }
}