本文整理匯總了TypeScript中response/form/models/statement-of-means/expenseSource.ExpenseSource.fromObject方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ExpenseSource.fromObject方法的具體用法?TypeScript ExpenseSource.fromObject怎麽用?TypeScript ExpenseSource.fromObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類response/form/models/statement-of-means/expenseSource.ExpenseSource
的用法示例。
在下文中一共展示了ExpenseSource.fromObject方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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:
.map(source => ExpenseSource.fromObject(source.name, source))
示例3: 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)
)
}