$stateParams not working correctly in Tabs template


#1

I am creating a news feed app for a clients association and I have already developed the CRUD app for them to add new listings, which upon SUBMIT, get pushed to Firebase. Now I am creating the app that pulls down the data and displays in a list using ng-repeat…fairly straight forward from here. I am having a bit of an issue with $stateParams binding with the correct id.

Here is the Plunk http://plnkr.co/edit/jhbRhQ?p=preview - just click on the middle tab that says feed. I’ve submitted 4 test posts. The first one on the list in correct, you click on the title and it takes you to its view and shows the proper description, but if you click on the posts below it, the view shows the description of the post below it, with the last one (test4) being empty.

I have the firebase setup in the services.js file.

Any help would be most appreciated. Thank you.
Chuck


#2

I figured out what was going on. If you use id as an object in Firebase (maybe from a json file as well, not sure), you must start with id: 0, if you start with id: 1, your posts or lists wont match up.