title: How to Pass JSON Object value From HTML Onclick function to JavaScript ? MVC
body: <p>I am working on MVC trying to pass id on click button from HTML to JS my code where i am creating table in HTML is,</p>
  
  <pre><code>&lt;tbody&gt;
                      &lt;tr ng-repeat="Survey in vm.AllSurveys"&gt;
                          &lt;td&gt;{{Survey.visitNumber}} &lt;/td&gt;
                          &lt;td&gt;{{Survey.id}}&lt;/td&gt;
                          &lt;td&gt;
                              &lt;button id="myButton" onclick="myFunction('{{Survey.id}}');"&gt;Home&lt;/button&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
  </code></pre>
  
  <p>On click function is like,</p>
  
  <pre><code>function myFunction(id) {
      console.log(id);
      location.href = "http://localhost/Test?visitId="+id;
  }
  </code></pre>
  
  <p>I have data in this format,</p>
  
  <pre><code>[{VisitNumber: "Visit_U_1", id: "107"},... So on]
  </code></pre>
  
  <p>But i got this error in html onclick line,</p>
  
  <pre><code>Error: [$compile:nodomevents] http://errors.angularjs.org/1.3.9/$compile/nodomevents
      at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js:6:416
      at pre 
   &lt;button id="myButton" onclick="myFunction('{{Survey.id}}');"&gt; 
  </code></pre>
  
  <p>I tried solutions but did not get success
  Hopes for your suggestions</p>