title: angular doesn't print data after scanning qr
body: <p>I'm working with <code>NativeStorage</code> and <code>barcodeScanner</code> plugins for <code>cordova</code>.</p>
  
  <p>The capture works well, and I receive the <code>QRCode</code>, but for any reason angular doesn't print it.</p>
  
  <p>After working a lot on my code, I'm not able to do a valid callback, so angular can print it binding the data.</p>
  
  <p>Here bellow I paste the code.</p>
  
  <p><strong>read.js</strong></p>
  
  <pre><code>(function() {
    'use strict';
  
    var read = angular.module('app.read', ['monospaced.qrcode']);
  
    read.controller('ReadController', [
      function() {
  
        var data = this;
  
        var qr = function(string) {
          data.code = string;
          console.log(string);
        };
  
        cordova.plugins.barcodeScanner.scan(
          function(result) {
            if (!result.cancelled) {
              if (result.format === "QR_CODE") {
                (function(cb) {
                  cb(result.text);
                })(qr);
                NativeStorage.getItem("historic", function(d) {
                  var storage = JSON.parse(d);
                  storage.push(result.text);
                  NativeStorage.setItem("historic", JSON.stringify(storage), function(response) {}, function(e) {
                    console.log(e);
                  });
                }, function(e) {
                  window.alert("Scanning failed: " + e);
                });
              }
            }
          },
          function(e) {
            window.alert("Scanning failed: " + e);
          }, {
            "preferFrontCamera": true, // iOS and Android 
            "showFlipCameraButton": true, // iOS and Android 
            "prompt": "Place a barcode inside the scan area", // supported on Android only 
            "formats": "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED 
            "orientation": "portrait" // Android only (portrait|landscape), default unset so it rotates with the device 
          }
        );
      }
    ]);
  
  }());
  </code></pre>
  
  <p><strong>read.html</strong></p>
  
  <pre><code>&lt;div ng-controller="ReadController as myRead"&gt;
    &lt;qrcode version="5" error-correction-level="H" size="200" data="{{myRead.code}}" href="{{myRead.code}}"&gt;&lt;/qrcode&gt;
    &lt;a href="{{myRead.code}}"&gt;{{myRead.code}}&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Just adding some extra tests I have done before, I just missed the <code>barcodeScanner.scan</code> process and I did just the storage as I show bellow:</p>
  
  <pre><code>NativeStorage.getItem("historic", function (d) {
     var storage = JSON.parse(d);
     storage.push('https://google.es');
     data.code = 'https://google.es';
     NativeStorage.setItem("historic", JSON.stringify(storage), function (response) {}, function (e) {
        console.log(e);
     });
  }, function (e) {
     window.alert("Scanning failed: " + e);
  });
  </code></pre>
  
  <p>Could you show me where am I wrong?</p>
  
  <p>Thanks in advice.</p>