A simple way to deal with cross dependencies transparently in AngularJS