title: Angulajrs - how to set bootstrap tab active
body: <p>I have a tab pane in a modal.
  Each time I open the modal I want the first tab to be active.
  My problem is that if I open the modal, go to the second tab and close the modal, next time I open this modal the second tab is set to active.
  How can I set the first tab always active in my angularjs controller?</p>
  
  <p>Here is my tab html code:</p>
  
  <pre><code>&lt;button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#saveClientModal"&gt;
          &lt;span class="glyphicon glyphicon-flash"&gt;&lt;/span&gt; open modal
  &lt;/button&gt;
   &lt;div id="saveClientModal" class="modal fade" tabindex="-1"  data-backdrop="static" data-keyboard="false"  role="dialog"&gt;
       &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
              &lt;/div&gt;
  
              &lt;div class="modal-body"&gt;
                  &lt;div class="tabbable"&gt; &lt;!-- Only required for left/right tabs --&gt;
                      &lt;ul class="nav nav-tabs"&gt;
                          &lt;li class="active"&gt;&lt;a href="" data-target="#tab1" data-toggle="tab"&gt;Tab1&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="" data-target="#tab2" data-toggle="tab"&gt;Tab2&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                      &lt;div class="tab-content"&gt;
                          &lt;div class="tab-pane active" id="tab1"&gt;
                          ...
                          &lt;/div&gt;
                      &lt;/div&gt;
                          &lt;div class="tab-pane" id="tab2"&gt;
                          ...
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks</p>