我開始使用Firebase(AngularFire)爲我的應用程序同步我的數據。這是一款適用於Scrum的卡片工具,可以將卡片添加到數組中。您可以操縱輸入字段。我的AngularFire/AngularJS項目中的一次擊鍵後,Firebase讓我停止打字
首先我使用localStorage,它工作得很好。現在我基本上已經實現了Firebase,但我遇到了以下問題:在一個字段中輸入單個鍵後,應用程序停止並且只有在輸入字段中再次單擊才能恢復鍵入。
你知道這是爲什麼嗎?非常感謝您提前!
這是我的基本實現,我控制器:
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>
此標記包含在指令中嗎?如果不是,$ scope.card指定在哪裏? –
bennlich
p.s.我的第一個猜測是,這實際上是http://stackoverflow.com/questions/15119086/angular-js-cant-edit-dynamically-created-input-fields(也許令人驚訝的與Firebase/AngularFire無關!)的副本。 – bennlich
是的,它是在一個重複的「卡片卡」中。 – christophe