title: how to pass variables to event listener method in d3
body: <p>I'm working with <strong>d3</strong>, <strong>svg</strong> and <strong>AngularJS</strong>.</p>
  
  <p>I've written some code to handle <code>mouseup</code> event on an svg element using d3. The code is as follows:</p>
  
  <pre><code>&lt;svg&gt;
      &lt;!-- some other code--&gt;
  &lt;/svg&gt;
  
  function myFunction() {
      var isMouseUp = false;
      d3.select("svg").on("mouseup", func1);
  }
  
  function func1() {
      isMouseUp = true;
  }
  </code></pre>
  
  <p>As you can see, <code>isMouseUp</code> is a local variable to <code>myFunction()</code>.
  I have to pass it to <code>func1()</code>. How can I do so?</p>
  
  <p>P.S. I can't make <code>isMouseUp</code> global. Also I can't make <code>func1()</code> local to <code>myFunction()</code>.</p>