title: get the file from ng-change
body: <p><strong>How to convert this to angular.js compitable so that i get the dataurl and send through $http.post</strong></p>
  
  <pre><code>&lt;input type="file" id="imgfiles" name="imgfiles" accept="image/jpeg" onchange="readURL(this);"&gt;
  
  
  function readURL(input) {
      if (input.files[0].size &lt;= 1048576) {
          if (input.files &amp;&amp; input.files[0]) {
              var reader = new FileReader();
              reader.onload = function (e) {
                  $('#cam_photo').attr('src', e.target.result).width(250).height(230);
                  var a = $('#cam_photo').attr('src');
                  data_url = a;
              };
              reader.readAsDataURL(input.files[0]);
          }
      } else {
          alert('File is too large. Upload file less than 1MB');
      }
  }
  </code></pre>