I'am using in an index page md-tab-group
where I do have two tabs and each tab has its own component - signin.component
and register.component
:
<md-tab-group>
<md-tab label="signin"></md-tab>
<md-tab label="register"></md-tab>
<md-tab-group>
By loading the page, the signin
tab is activated/selected by default. But when a user switch to register-tab and submits the register form, which is working fine, then I would like to switch to the signin
tab and make it selected. Means that the user can login after registration - which makes sense.
The Issue is that I can't manage to move and select/activate the signin
tab after registration. the register
tab keeps selected, which would confuse the users.
The <md-tab-group>
is being directly embedded in signin.component.html
and the register form is being loaded via router when clicking the register tab:
<md-tab-group #tabGroup>
<md-tab label="signin">
<form>
<input....>
</form>
</md-tab>
<md-tab label="regsiter">
<router-outlet name="register"></router-outlet>
</md-tab>
</md-tab-grou>
I tried couple of ideas but unfortunately none of them gave me the expected result.
Any Hint or Idea please?