Ionic tab badge value not updating properly

This could be my a misunderstanding of how Angular controllers work, but I am trying to understand why the badge values for my tabs are not being updated.

I have isolated the issue to a Codepen here:

I ended up finding a solution that involves creating another controller that the badge value looks at. I have modified the isolated Codepen slighty to demonstrate:

The thing is, I just don’t understand why it needs to be done this way. What fundamental knowledge am I missing here?