firebase/angularFire — pull request #147 by mchcoastal (2013-11-01 15:30:33+00:00)
Title: Address handling of priority in angularFireCollection.

This is an attempt to handle the reordering of collections via priority. It is possibly related to issue #19.

The problems I witnessed locally were that AngularFireItem's $priority and $index rapidly became inconsistent after a series of ref.setPriority() invocations changed the order of elements.

This patch attempts to solve those problems by updating $priority within the child_moved handler, and to be a little more careful with the index range when updating indexes after moving an item in the collection.

The included test case covers the symptoms I witnessed but may not be entirely inclusive of other issues surrounding priority. For example, I'm unsure if events other than child_moved can update a Firebase item's priority.