tab selection from controllers

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