/** Angular Imports */ import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute , Router } from '@angular/router' ; import { MatDialog } from '@angular/material/dialog' ; /** Custom Services */ import { OrganizationService } from 'app/organization/organization.service' ; /** Custom Components */ import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component' ; /**
 * View Teller Component.
 */ @ Component ( { selector : 'mifosx-view-teller' , templateUrl : './view-teller.component.html' , styleUrls : [ './view-teller.component.scss' ] } ) export class ViewTellerComponent implements OnInit { /** Teller data. */ tellerData : any ; param { OrganizationService } organizationService param { ActivatedRoute } route param { Router } router param { MatDialog } dialog constructor ( private organizationService , private route , private router , public dialog ) { this . route . data . subscribe ( ( data ) => { this . tellerData = data . teller ; } ) ; } ngOnInit ( ) { } /**
     * Deletes the teller and redirects to tellers.
     */ deleteTeller ( ) { const deleteTellerDialogRef = this . dialog . open ( DeleteDialogComponent , { data : { deleteContext : `teller ${ this . tellerData . id }` } } ) ; deleteTellerDialogRef . afterClosed ( ) . subscribe ( ( response ) => { if ( response . delete ) { this . organizationService . deleteTeller ( this . tellerData . id ) . subscribe ( ( ) => { this . router . navigate ( [ '/organization/tellers' ] ) ; } ) ; } } ) ; } }