Listen to $stateChangeSuccess to work with ionic