私は編集ボタンを選択する更新タイプの関数を作成しようとしており、編集するコメントの説明に焦点を当てています。しかし、私は編集したい特定の投稿の具体的な説明を取得する方法を理解していません。ここでは...角2のフォーカス指示命令の問題
<div>
<p [contentEditable]="isEditable" [focus]="inputFocused">Test 1</p>
<button (click)="Edit()">edit 1</button>
</div>
<div>
<p [contentEditable]="isEditable" [focus]="inputFocused">Test 2</p>
<button (click)="Edit()">edit 2</button>
</div>
htmlと私が達成しようとしているものの概念の一部であり、ここでそのIを受け入れるまで、私は開いていたすべてのコードディレクティブでplunkerとすべてhttps://plnkr.co/edit/HSuLScvffC0G5sfMHjJ5?p=preview
です間違った方法でこれに近づいている可能性があります。どんな方向にも大いに感謝します。
あなたの 'isEditable'と' inputFocused'変数は非ディスクです控訴。 – silentsod
はい、100のコメントがあるとしますが、編集したいコメントを区別するために100ブーリアンを作成する必要はありません。私ができる設定の 'this.comment.focus'タイプのようなものがありますか? – Bean0341
これをチェックしてくださいhttps://plnkr.co/edit/yrDLST1teuJCopnPafZR?p=preview – yurzui