當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ExpenseSource.fromObject方法代碼示例

本文整理匯總了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
     )
   )
 })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:9,代碼來源:expenseSource.ts

示例2:

 .map(source => ExpenseSource.fromObject(source.name, source))
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:1,代碼來源:monthlyExpenses.ts

示例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)
    )
  }
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:24,代碼來源:monthlyExpenses.ts


注:本文中的response/form/models/statement-of-means/expenseSource.ExpenseSource.fromObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。