Fix build error
parent
aad964d659
commit
b78cf09e23
|
|
@ -4,7 +4,7 @@
|
|||
<secondary-page-component [fixedSideBar]="true">
|
||||
<div mainContent>
|
||||
<form [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||
<div formArrayName="contributions" *ngFor="let item of form.get('contributions').controls; let i = index;">
|
||||
<div formArrayName="contributions" *ngFor="let item of getContributionsFormArray().controls; let i = index;">
|
||||
<div class="m-1 mt-2 bb-1" [formGroupName]="i">
|
||||
<button class="w-5" type="button" mat-icon-button (click)="deleteContributor(i)">
|
||||
<i ofbicon>delete_forever</i>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Transaction } from './transaction';
|
||||
import { UserService } from 'src/app/services/user.service';
|
||||
import { UserService } from '../../services/user.service';
|
||||
import { Contribution } from './contribution';
|
||||
import { FormBuilder, FormGroup, Validators, FormArray } from '@angular/forms';
|
||||
import { checkNumberValidator } from './check-number-validator';
|
||||
import { contributorValidator } from './contributor-validator';
|
||||
import { TransactionService } from 'src/app/services/transaction.service';
|
||||
import { TransactionService } from '../../services/transaction.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-transaction-page',
|
||||
|
|
@ -39,6 +39,10 @@ export class AddTransactionPageComponent implements OnInit {
|
|||
this.userService.getAll().subscribe(res => this.contributors = (<any>res).users);
|
||||
}
|
||||
|
||||
getContributionsFormArray(): FormArray {
|
||||
return this.form.get('contributions') as FormArray;
|
||||
}
|
||||
|
||||
getContribution(): FormGroup {
|
||||
const date = new Date();
|
||||
const dte = date.getFullYear() + "-" + (date.getMonth()<10?'0':'') + (date.getMonth() + 1) + "-" + (date.getDate()<10?'0':'') + date.getDate();
|
||||
|
|
|
|||
Loading…
Reference in New Issue