[angular-ui] How to detect current state within directive