#formControl null ?

10 messages · Page 1 of 1 (latest)

silver lily
#

Hello i have create some news formControls, but my problem is this formControls is null, i don't know why ? And i can't use my fields too.

quartz hornet
#

Post the relevant code, as text. We can't tell much for tiny snippets of code posted as images.

#

g!codeblock @silver lily

balmy oxideBOT
#

@silver lily, you can use the following snippet to have your code formatted and colored by Discord. Replace ts with the language you need (i.e. html, js, css, etc)
```ts
// your code goes here
```

silver lily
#

Ok np

#
value: {
                  productId: '',
                  name: '',
                  itemId: '',
                  id: '',
                  type: '',
                  count: 0,
                  amount: 0,
                },``` My formControls

```html
<div [formGroup]="returnFormArray().controls[i].controls.value">
          <ng-container *ngFor="let innerItem of conditionalGroup.value.awardSpec">
            <ng-container *ngIf="innerItem.value.id === 'ItemPiece'">
              <mat-form-field class="itemId-input">
                <mat-label>Item ID</mat-label>
                <input matInput type="text" formControlName="itemId">
              </mat-form-field>
              <mat-form-field class="count-input">
                <mat-label>Count</mat-label>
                <input matInput type="number" formControlName="count" min="0" required>
              </mat-form-field>
            </ng-container>
  
            <ng-container *ngIf="innerItem.value.id === 'Landmark'">
              <mat-form-field class="name-input">
                <mat-label>Name</mat-label>
                <input matInput type="text" formControlName="name">
              </mat-form-field>
              <mat-form-field class="amount-input">
                <mat-label>Amount</mat-label>
                <input matInput type="number" formControlName="amount" min="0" required>
              </mat-form-field>
            </ng-container>
          </ng-container>
        </div>```. my template
quartz hornet
#

Also tell us, very specifically, what you're doing, what you expect to happen and what happens instead.

silver lily
#

Sorry i'm beginner with Angular

quartz hornet
#

We can't see your screen. We have no idea of where your first snippet is, what it's used for, etc. We can't see your screen, so the code you don't post is unknown to us.

silver lily
#

Ok sorry.