title: Angular.js - Passing $scope into jQuery function
body: <p>I'm using jQuery File Uploader through Angular.js. I need to pass the server's response from the image upload to the Angular $scope, but I can't access the $scope within the <code>done</code> function:</p>
  
  <pre><code>   function LandmarkNewCtrl($location, $scope, db) {
        $('#fileupload').fileupload({
           url: '/api/upload',
           dataType: 'text',
           done: function (e, data) {
  
              $scope.landmark.avatar = data.result;
  
           }
        });
    }
  </code></pre>
  
  <p>Getting "Uncaught TypeError: Cannot read property 'landmark' of undefined" errors.</p>
  
  <p>How do I pass $scope into the <code>done: function()</code> ?</p>