title: get echarts on click event to change value of variable attached to $scope in angularjs
body: <p>I am using echarts in my angularjs project. I would prefer not to have to use the ng-echarts module if possible. I would like to be able to get a click event on the chart object to change the value of a variable on the $scope that can be used to toggle ng-show</p>
  
  <p>My code in the controller is like this:</p>
  
  <pre><code>myChart = echarts.init(document.getElementById('main'));
  
  // code that prepares the graph data goes here
  // ...
  
  myChart.setOption(option,true); 
  
  myChart.on('click', function(e) {
  
    //this works fine
    console.log(e) 
  
    // this does nothing
    $scope.showDiv = true //this does nothing
  })
  </code></pre>
  
  <p>Is there a way of getting the <code>$scope.showDiv = true</code> to actually work on a <code>&lt;div ng-if="showDiv"&gt;test&lt;/div&gt;</code> in the view?</p>
  
  <p>I have searched the documentation and other sources but couldn't find anything.</p>