本文整理匯總了TypeScript中response/form/models/statement-of-means/expenseSource.ExpenseSource類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ExpenseSource類的具體用法?TypeScript ExpenseSource怎麽用?TypeScript ExpenseSource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ExpenseSource類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should return a new instance initialised with set fields from object parameter provided', () => {
expect(ExpenseSource.fromObject('name', SAMPLE_MONTHLY_EXPENSE_SOURCE_FROM_OBJECT)).to.deep.equal(
new ExpenseSource(
'name',
100,
IncomeExpenseSchedule.MONTH
)
)
})
示例2: resetExpense
resetExpense (propertyName: string, source: ExpenseSource): void {
this[`${propertyName.split('.')[0]}Declared`] = false
source.reset()
}
示例3:
.map(source => ExpenseSource.fromObject(source.name, source))
示例4: fromObject
static fromObject (value?: any): MonthlyExpenses {
if (!value) {
return value
}
return new MonthlyExpenses(
value.mortgageDeclared, ExpenseSource.fromObject(MonthlyExpenseType.MORTGAGE.displayValue, value.mortgage),
value.rentDeclared, ExpenseSource.fromObject(MonthlyExpenseType.RENT.displayValue, value.rent),
value.councilTaxDeclared, ExpenseSource.fromObject(MonthlyExpenseType.COUNCIL_TAX.displayValue, value.councilTax),
value.gasDeclared, ExpenseSource.fromObject(MonthlyExpenseType.GAS.displayValue, value.gas),
value.electricityDeclared, ExpenseSource.fromObject(MonthlyExpenseType.ELECTRICITY.displayValue, value.electricity),
value.waterDeclared, ExpenseSource.fromObject(MonthlyExpenseType.WATER.displayValue, value.water),
value.travelDeclared, ExpenseSource.fromObject(MonthlyExpenseType.TRAVEL.displayValue, value.travel),
value.schoolCostsDeclared, ExpenseSource.fromObject(MonthlyExpenseType.SCHOOL_COSTS.displayValue, value.schoolCosts),
value.foodAndHousekeepingDeclared, ExpenseSource.fromObject(MonthlyExpenseType.FOOD_HOUSEKEEPING.displayValue, value.foodAndHousekeeping),
value.tvAndBroadbandDeclared, ExpenseSource.fromObject(MonthlyExpenseType.TV_AND_BROADBAND.displayValue, value.tvAndBroadband),
value.hirePurchaseDeclared, ExpenseSource.fromObject(MonthlyExpenseType.HIRE_PURCHASES.displayValue, value.hirePurchase),
value.mobilePhoneDeclared, ExpenseSource.fromObject(MonthlyExpenseType.MOBILE_PHONE.displayValue, value.mobilePhone),
value.maintenanceDeclared, ExpenseSource.fromObject(MonthlyExpenseType.MAINTENANCE_PAYMENTS.displayValue, value.maintenance),
value.otherDeclared, value.other && value.other
.map(source => ExpenseSource.fromObject(source.name, source))
.filter(source => source !== undefined)
)
}