$scope.onFileSelect = function ($files) {
$scope.loading = true;
//$files: an array of files selected, each file has name, size, and type.
file = $files[0];
var img = new Image();
img.src = _URL.createObjectURL(file);
img.onload = function () {
if (this.width > sizes.width && this.height > sizes.height) {
console.log("good size");
} else {
console.log("check the sizes of your image");
$scope.loading = false;
}
};
but the $scope.loading
will remain the same after the the onload block instead of being equal to false.