I have a system that generates QR codes for an invoice. The image for the QR code is pulled from another service online.
For my view I have
<div class="jumbotron" ng-show="invoiceReady">
.. where I set invoiceReady to true once my JS calculates the various amounts.
$scope.qrImgUrl = 'http://www.btcfrog.com/qr/bitcoinPNG.php?address=' + $scope.invoiceData.btcAddress + '&amount=' + $scope.invoiceData.btcAmount;
$scope.invoiceReady = true;
But what I need to do is wait a little longer until the image loads in my view. As ng-show shows the invoice view.. but it takes a few seconds longer for the QR image to actually load.
<img ng-src="{{qrImgUrl}}" />
I could use $timeout to wait a couple more seconds to cover that image load time. And I'm curious if there is a way to programatically catch when the image actually does load?