Changed the way onenter and on exit works for $stateTransitionProvider the array way of defining a function and dependencies works