/** Angular Imports */ import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute , Router } from '@angular/router' ; import { MatDialog } from '@angular/material/dialog' ; /** Custom Services */ import { SystemService } from '../../system.service' ; /** Custom Components */ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component' ; /**
 * View Account Number Preference Component.
 */ @ Component ( { selector : 'mifosx-view-account-number-preference' , templateUrl : './view-account-number-preference.component.html' , styleUrls : [ './view-account-number-preference.component.scss' ] } ) export class ViewAccountNumberPreferenceComponent implements OnInit { /** Account Number Preference Data */ accountNumberPreferenceData : any ; param { SystemService } systemService param { ActivatedRoute } route param { Router } router param { MatDialog } dialog constructor ( private route , private systemService , private router , private dialog ) { this . route . data . subscribe ( ( data ) => { this . accountNumberPreferenceData = data . accountNumberPreference ; } ) ; } ngOnInit ( ) { } /**
     * Deletes the account number preference and redirects to account number preferences.
     */ delete ( ) { const deleteAccountNumberPreferenceDialogRef = this . dialog . open ( DeleteDialogComponent , { data : { deleteContext : `account number preference ${ this . accountNumberPreferenceData . id }` } } ) ; deleteAccountNumberPreferenceDialogRef . afterClosed ( ) . subscribe ( ( response ) => { if ( response . delete ) { this . systemService . deleteAccountNumberPreference ( this . accountNumberPreferenceData . id ) . subscribe ( ( ) => { this . router . navigate ( [ '/system/account-number-preferences' ] ) ; } ) ; } } ) ; } }