Take a look at this Plunker demo link
I have encountered an issue after implementing the orderby feature (line 24) in my application. When I try to add an item without priority and then add another one with priority, followed by deleting the first item, the deleted item does not behave as expected.
Even after passing the $index to the function, I am unable to find a solution to this problem.