本文实例为大家分享了angularjs上传多张图片并预览的具体代码,供大家参考,具体内容如下
directive.js
/*
* 多图片上传及预览指令(需指定图片类名)
*
*/
angular.module('routerModule').directive('fileModel', ['$parse', 'fileReader', function($parse, fileReader) {
return {
restrict:'A',
link:function(scope, element, attrs, ngModel) {
var model = $pars