title: How to open a modal in javascript instead of manual click?
body: <p>I have a modal which is open when i click on a button. Now i want to open the modal in a javascript function. 
  Here is the working modal : </p>
  
  <pre><code>&lt;a href="#" class="btn btn-lg btn-primary" id="sentMessage" data-toggle="modal" data-target="#largeModal"&gt;Click to open Modal&lt;/a&gt;
      &lt;div class="modal fade" id="largeModal" tabindex="-1" role="dialog" aria-labelledby="largeModal" aria-hidden="true"&gt;
        &lt;div class="modal-dialog modal-lg"&gt;
          &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
              &lt;h4 class="modal-title" id="myModalLabel"&gt;Large Modal&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
              &lt;h3&gt;Modal Body&lt;/h3&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
              &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
              &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I want to open the same modal in a javascript function. So to simulate this function, i create another button which trigger a function :</p>
  
  <pre><code>&lt;a href="#" ng-click="openModal();" class="btn btn-lg btn-primary"&gt;Click to execute js&lt;/a&gt;
  </code></pre>
  
  <p>Here is my openModal function : </p>
  
  <pre><code>$scope.openModal = function(){
      $("#sentMessage").click();
  
  };
  </code></pre>
  
  <p>When i click on the button "Click to execute js", the modal does not open. 
  Here is the <a href="http://plnkr.co/edit/JM9UALvZMx6FGzUqvrEB?p=preview" rel="noreferrer">plunker</a> </p>