/** Angular Imports */ import { Component , OnInit } from '@angular/core' ; import { FormControl , FormBuilder } from '@angular/forms' ; import { Router , ActivatedRoute } from '@angular/router' ; /** Custom Services */ import { LoansService } from '../../../loans.service' ; /**
 * Undo Disbursal component.
 */ @ Component ( { selector : 'mifosx-undo-disbursal' , templateUrl : './undo-disbursal.component.html' , styleUrls : [ './undo-disbursal.component.scss' ] } ) export class UndoDisbursalComponent implements OnInit { /** Loan ID. */ loanId : any ; /** Undo disbursal form. */ note : FormControl ; param { FormBuilder } formBuilder param { LoansService } loansService param { ActivatedRoute } route param { Router } router constructor ( private formBuilder , private loansService , private router , private route ) { this . loanId = this . route . parent . snapshot . params [ 'loanId' ] ; } /**
     * Creates the undo disbursal form.
     */ ngOnInit ( ) { this . note = this . formBuilder . control ( '' ) ; } /**
     * Submits the undo disbursal form.
     */ submit ( ) { this . loansService . loanActionButtons ( this . loanId , 'undodisbursal' , { 'note' : this . note . value } ) . subscribe ( ( response ) => { this . router . navigate ( [ '../../general' ] , { relativeTo : this . route } ) ; } ) ; } }