How to perform click on Angular Material md-tab
<p>I have a <code>md-tabs</code> tag which 2 <code>md-tab</code> tags:</p>

<pre><code>        &lt;md-tabs id="tabs" class="md-accent" md-align-tabs="top" md-dynamic-height&gt;
            &lt;md-tab id="tab1"&gt;
                &lt;md-tab-label&gt;Tab 1&lt;/md-tab-label&gt;
                &lt;md-tab-body&gt;
                    &lt;div ng-include="'tab1.html'"&gt;&lt;/div&gt;
                &lt;/md-tab-body&gt;
            &lt;/md-tab&gt;
            &lt;md-tab id="tab2"&gt;
                &lt;md-tab-label&gt;Tab 2&lt;/md-tab-label&gt;
                    &lt;md-tab-body&gt;
                        &lt;div ng-include="'tab2.html'"&gt;&lt;/div&gt;
                    &lt;/md-tab-body&gt;
            &lt;/md-tab&gt;
        &lt;/md-tabs&gt;
</code></pre>

<p>I can switch between them properly by clicking in them (in the menu) but what I want is to be able to perform click on <code>tab1</code> for example. Let's say that inside on <code>tab2</code> I make a submit via <code>AJAX</code> and once I get the <code>success</code> I want to switch automatically to <code>tab1</code>.</p>

<p>I've tried lot of things, I've set the attribute <code>selectedIndex</code> from <code>md-tabs</code>, I've set the attribute <code>md-active</code> of <code>md-tab</code> to <code>true</code>. I've also tried to call the method which supposedly is fired by event click (<code>select()</code> from <code>$mdTabsCtrl</code>). But obviously nothing of this has worked.</p>

<p>So, how can I switch to a specific tab when I click one of my custom buttoms?</p>