アプリケーションのデータを同期するために、Firebase (AngularFire) の使用を開始しました。配列にカードを追加するスクラム用のカード ツールです。入力フィールドを操作できます。
最初に localStorage を使用しましたが、これは非常にうまく機能しました。基本的に Firebase を実装したので、次の問題が発生しました。1 つのフィールドに 1 つのキーを入力した後、アプリケーションが停止し、入力を再開する唯一の方法は、入力フィールドをもう一度クリックすることです。
これがなぜなのか知っていますか?事前にどうもありがとうございました!
それが私のControllerでの基本的な実装です:
Card = (@color, @customer, @points, @number, @projectName, @story) ->
$scope.cards = []
reference = new Firebase("https://MYACCOUNT.firebaseio.com/list")
angularFire(reference, $scope, "cards")
$scope.reset = ->
$scope.cards = []
$scope.addCardRed = (customer) ->
$scope.cards.push new Card("red", customer)
それが私のマークアップです:
<div class="card card-{{ card.color }}">
<header>
<input class="points" contenteditable ng-model="card.points"></input>
<input class="number" placeholder="#" contenteditable ng-model="card.number"></input>
<input class="customerName" contenteditable ng-model="card.customer.name"></input>
<input class="projectName" placeholder="Projekt" contenteditable ng-model="card.projectName"></input>
</header>
<article>
<input class="task" placeholder="Titel" contenteditable ng-model="card.task"></input>
<textarea class="story" placeholder="Story" contenteditable ng-model="card.story"></textarea>
</article>
<footer>
<div class="divisions">
<p class="division"></p>
<button ng-click="deleteCard()" class="delete">X</button>
</div>
</footer>
</div>
<div class="card card-{{ card.color }} backside">
<article>
<h2 class="requirement">Requirements</h2>
<textarea class="requirements" placeholder="Aspects" contenteditable ng-model="card.requirements"></textarea>
</article>
</div>