Helenr
给你一段刚好在用的代码参考下:directive:angular.module('imageupload', []).directive('myCustomer', function() { return { restrict: 'A', scope: { image: '=', resizeMaxHeight: '@?', resizeMaxWidth: '@?', resizeQuality: '@?', resizeType: '@?', selectedfile: '&onFileSelected'
}, link: function postLink(scope, element, attrs, ctrl) {
}
};
});html<input type="file"
name="file"
class="upload"
id="inputImage2"
accept="image/*"
image="image2"
resize-max-height="300"
resize-max-width="250"
resize-quality="0.5" on-file-selected="transferedImage(imageResult)"/>