ボタンとして3つの入力要素が用意されています。 ng-keyupでは私のコントローラで関数を呼び出す。angle ng-focus/focus入力要素
今の問題は、私は手動でkeyUpイベントが動作するだけにして、フォーカスを得るためにそれらのいずれかをクリックする必要があります。
ng-focus = 'focus'を試した後、コントローラで$ scope.focus = trueを設定しても動作しませんでした。
<div class="row startButtonRow">
<div class="col col-50" align="center">
<button class="button button-dark startButton" ng-click="start()" ng-disabled="disableStart">Start</button>
</div>
<div class="col" align="center">
<input ng-focus="focus" type="button" class="button button-dark startButton" ng-disabled="disableStop" ng-keyup="stopTimer($event)">
</div>
<div class="col" align="center">
<input type="button" class="button button-dark startButton" ng-disabled="disableStop" ng-keyup="stopTimer($event)">
</div>
<div class="col" align="center">
<input type="button" class="button button-dark startButton" ng-disabled="disableStop" ng-keyup="stopTimer($event)">
</div>
</div>
私はシンボルが3つの列に表示されて起動スタートボタンをクリックして、私は、対応するボタン(キーアップと、ここで入力要素)を押すことになっていたら、すぐに特定のシンボルが表示されます。最初に要素をクリックしてからキーボードのキーを使うことはできません。
私はNG-からkeyupについてのあなたの最初のポイントを取得し、私はそれに気づきました実装されました。マウスのクリックではなくキーボードの<-, ^, ->ボタンで3つのボタンを押すことは可能ですか?私はそれに答えが見つからなかったので、私は入力とngキーアップに行きました。はい、私は間違いを犯しました - フォーカス、おかげで! – Nitish
私の答えに編集を参照してください –
パーフェクト!どうもありがとう! – Nitish