tab selection from contorllers

I refactor directive api.
This approach makes code simply and  clear, thanks