Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
152 views
in Technique[技术] by (71.8m points)

javascript - How to make an editable field? Angular

Greeting, the whole code is a little long and the whole is here:

https://stackblitz.com/edit/test-trainin-2-gv9glh?file=src%2Fapp%2Fapp.component.ts

First check this field:

    <input
      oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
     type="number"
      class="input-invisible-for-div weight width-45 font-s"
      maxlength="3"
      minlength="1"
      max="600"
      min="0"
      [(ngModel)]="selectedValue ? selectedValue : training.selected"
      />

This is a field that needs to be editable It is field which i need to send as value here:

const objToSend2 = { 
  setId: jotOfSet,
  reps: set.reps,
  value: this.selectedValue,
  completed: true 

}

The current value of this field is initially see onIniti

  el["selected"] = el.sets[0]?.value;

When you click the ball twice, the value of that field is the next value.. All I want is to be able to change that field as much as I want and this addition of +5 and -5 On double click on ball I call first function singleClickForTraining then inside singleClickForTraining i call finishedExerciseSet.

question from:https://stackoverflow.com/questions/65883510/how-to-make-an-editable-field-angular

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...