title: How can I change the text on the button when user selects one option from the dropdown? (angular.js)
body: <p>I'm writing a webpage with angular.js and bootstrap and I have a component exactly like <a href="http://jsfiddle.net/xkL15guj/" rel="nofollow">this one</a>
  When user unfolds the menu and choses the action - I want to change the text on the button. So far my code looks as follows:</p>
  
  <pre><code>&lt;div class="btn-group"&gt;
      &lt;button type="button" class="btn btn-danger" ng-click="queryUsers()"&gt;Show data from last hour&lt;/button&gt;
      &lt;button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"&gt;
          &lt;span class="caret"&gt;&lt;/span&gt;
          &lt;span class="sr-only"&gt;Toggle Dropdown&lt;/span&gt;
      &lt;/button&gt;
      &lt;ul class="dropdown-menu" role="menu"&gt;
           &lt;li&gt;&lt;a ng-click="queryUsersFromYesterday()"&gt;Show data from yesterday&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a ng-click="queryUsersFromLastWeek()"&gt;Show data from last week&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a  ng-click="queryUsersFromLastMonth()"&gt;Show data from last month&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Right now when user clicks: show data from last week - the menu disappears, but the button still has a text: show data from last hour. How can I dynamically change the text on the button?</p>