import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute } from '@angular/router' ; @ Component ( { selector : 'mifosx-view-loan-product' , templateUrl : './view-loan-product.component.html' , styleUrls : [ './view-loan-product.component.scss' ] } ) export class ViewLoanProductComponent implements OnInit { loanProduct : any ; variationsDisplayedColumns : string [ ] = [ 'valueConditionType' , 'borrowerCycleNumber' , 'minValue' , 'defaultValue' , 'maxValue' ] ; chargesDisplayedColumns : string [ ] = [ 'name' , 'chargeCalculationType' , 'amount' , 'chargeTimeType' ] ; paymentFundSourceDisplayedColumns : string [ ] = [ 'paymentTypeId' , 'fundSourceAccountId' ] ; feesPenaltyIncomeDisplayedColumns : string [ ] = [ 'chargeId' , 'incomeAccountId' ] ; constructor ( private route ) { this . route . data . subscribe ( ( data ) => { this . loanProduct = data . loanProduct ; } ) ; } ngOnInit ( ) { this . loanProduct . allowAttributeConfiguration = Object . values ( this . loanProduct . allowAttributeOverrides ) . some ( ( attribute ) => attribute ) ; } }