Angularjs:指令addEventListener错误

Angularjs:指令addEventListener错误,angularjs,Angularjs,我已经创建了一个指令来处理文件上传。上传模块在模式窗口打开时调用。我第一次调用模态窗口时,一切正常。如果我再次打开模式窗口,我将收到以下错误 Cannot call method 'addEventListener' of undefined 我是新手,所以如果我没有足够的信息来解决这个问题,请告诉我还需要什么 HTML <div class="row"> <div class="span5"> <h2>Upload New Image Galle

我已经创建了一个指令来处理文件上传。上传模块在模式窗口打开时调用。我第一次调用模态窗口时,一切正常。如果我再次打开模式窗口,我将收到以下错误

Cannot call method 'addEventListener' of undefined 
我是新手,所以如果我没有足够的信息来解决这个问题,请告诉我还需要什么

HTML

<div class="row">
<div class="span5">
    <h2>Upload New Image Gallery</h2>

    <form name="frm_upload" action="">
        <div class="control-group">
            <input image-uploadifive="{{galleryID}}" galleryid="{{galleryID}}" name="file_upload" type="file" multiple="true">
        </div><!-- /control-group -->
    </form>
    <div id="imageGallery_queue"></div>
</div><!-- /span5 -->
控制器

var myApp = angular.module('myApp',['ui.bootstrap', 'ui.sortable']);
函数imageGalleryCtrl($scope,images,clients,gallery,createGal) { $scope.galleryMaster={}

$scope.tabs = [
    { title:"Home", content:"/beta/application/views/images/uploader/create.html", active: true },
    { title:"Upload", content:"/beta/application/views/images/uploader/upload.html"},
    { title:"Edit", content:"/beta/application/views/images/uploader/edit.html"}
];

//close modal
$scope.close = function ()
{
    $scope.imageUploader = false;
};

//get gallery info on click from table
$scope.getGallery = function(id)
{
    //set gallery ID to scope
    $scope.galleryID = id;

    //open the modal
    $scope.imageUploader = true;

    //get gallery information
    $scope.galleryCollection = galleries.getGallery(id);

    $scope.galleryCollection.then(function(galleries){
        $scope.gallery = galleries.thisGal;
    });

    //get clients
    $scope.clientCollection = clients.getClients();

    $scope.clientCollection.then(function(clients){
        $scope.clients = clients.clients;
        $scope.clientList = $scope.gallery.client;
    });
};

$scope.tabName = function(name)
{
    if(name == 'Edit'){
        //get all the images 
        $scope.imgCollection = images.getImages($scope.galleryID);

        $scope.imgCollection.then(function(images){
            $scope.images         = images.thisGal_images;
            $scope.imageSortOrder = 'orgName';
        });
    }
};

$scope.newGallery = function()
{
    //open modal
    $scope.imageUploader = true;
    //create gallery
    $scope.newGallery = createGal.createGal();
    $scope.newGallery.then(function(createGal){
        $scope.galleryID = createGal.created_id;
    });
};

对此有任何见解都会有很大帮助。谢谢

评论说$scope.imageUploader为true会打开模式,但我不知道在哪里会发生这种情况。我也不知道是什么触发了$scope.close。似乎两者都与问题有关。谢谢。我正在使用ui.bootstrap处理模式。更新为showdle您可以创建JSFIDLE吗?小提琴无法显示我需要的东西。似乎第一次调用modal时,UPLOADIFE指令工作正常。当我关闭modal并在没有刷新页面的情况下再次调用时,我得到了错误。
$scope.tabs = [
    { title:"Home", content:"/beta/application/views/images/uploader/create.html", active: true },
    { title:"Upload", content:"/beta/application/views/images/uploader/upload.html"},
    { title:"Edit", content:"/beta/application/views/images/uploader/edit.html"}
];

//close modal
$scope.close = function ()
{
    $scope.imageUploader = false;
};

//get gallery info on click from table
$scope.getGallery = function(id)
{
    //set gallery ID to scope
    $scope.galleryID = id;

    //open the modal
    $scope.imageUploader = true;

    //get gallery information
    $scope.galleryCollection = galleries.getGallery(id);

    $scope.galleryCollection.then(function(galleries){
        $scope.gallery = galleries.thisGal;
    });

    //get clients
    $scope.clientCollection = clients.getClients();

    $scope.clientCollection.then(function(clients){
        $scope.clients = clients.clients;
        $scope.clientList = $scope.gallery.client;
    });
};

$scope.tabName = function(name)
{
    if(name == 'Edit'){
        //get all the images 
        $scope.imgCollection = images.getImages($scope.galleryID);

        $scope.imgCollection.then(function(images){
            $scope.images         = images.thisGal_images;
            $scope.imageSortOrder = 'orgName';
        });
    }
};

$scope.newGallery = function()
{
    //open modal
    $scope.imageUploader = true;
    //create gallery
    $scope.newGallery = createGal.createGal();
    $scope.newGallery.then(function(createGal){
        $scope.galleryID = createGal.created_id;
    });
};