0

I'm having trouble with setting values. I need to make input instead of divs and set values instead of getting them when in "editMode".

                <div class="geim__sets">
              <div *ngFor="let set of game.sets" class="geim__set">
                <div *ngIf="set.get('tbrType') === 1 && !editMode" >
                  <div class="set1">{{ set.get('scoreFirst') }}
                  </div>
                  <div class="set1">{{ set.get('scoreSecond') }}</div>
                </div>
                <div *ngIf="set.get('tbrType') === 2 && !editMode">
                  <div class="set2">{{ set.get('scoreFirst') }}
                    <span class="power">{{ set.get('tbrFirst') }}</span>
                  </div>
                  <div class="set2">{{ set.get('scoreSecond') }}
                    <span class="power">{{ set.get('tbrSecond') }}</span>
                  </div>
                </div>
                <div *ngIf="set.get('tbrType') === 3 && !editMode">
                  <div class="set3">[{{ set.get('scoreFirst') }}]</div>
                  <div class="set3">[{{ set.get('scoreSecond') }}]</div>
                </div>
              </div>
            </div>

Currently it only gets values, but how do I change it on Click?

Thanks in advance.

1 Answer 1

1

Using [(ngModel)] ?? Something like:

<ng-container *ngIf="set?.tbrType === 1 && !editMode" >
      <input name="scoreFirst" [(ngModel)]=set?.scoreFirst>
      <input name="scoreSecond" [(ngModel)]=set?.scoreSecond>
 </ng-container>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.