Watch $location for tab change, and select the tab automatically