difference between manually firing a javascript event and triggering default event
<p>Let us say I have a check box and a textbox. On click of check box I set some value in textBox.</p>

<p><strong>AngularJs Implementation</strong></p>

<pre><code>&lt;input type="checkbox" ng-model="filterPrivateDocModel" ng-click="filterPrivateDoc(filterPrivateDocModel)"&gt;
&lt;input st-search="target" ng-model="text" ng-change="setVal()"/&gt;
</code></pre>



<pre><code>$scope.filterPrivateDoc=function(val) {
  if (val) {
    angular.element('[ng-model="text"]').change();
  }
}

$scope.setVal=function() {
  angular.element('[ng-model="text"]').focus();
  $scope.text = 'Private';
}
</code></pre>

<p>It correctly sets the value of textBox on click of checkBox with value 'Private', but it does not filter the value, though my I am trying to call <strong>onchange event of javascript</strong> (using ng-change in angular) manually but still it does not work.</p>

<p>But the moment I start typing something on textbox any character it triggers the setValue (onchange event of javascript) and filters the data. Why ??</p>

<p>So my question are</p>

<p>(1)  <strong>What is the difference between manually calling a javascript onchange
       event and default trigger??</strong></p>

<p>(2)  <strong>And how can I make it to work in my case without typing anything on
         textbox and filter starts working.</strong></p>