0

I'm trying to make plupload work in modal window, generated by ng-dialog. The code is:

$scope.showManager = function(){
  ngDialog.open({
    template: '/template/fmanager.html',
    controller: 'FileManagerController'
  });
}

app.controller('FileManagerController', function($scope){
    $scope.plupload = new plupload.Uploader({
        browse_button: 'browseFileButton',
        url: '/upload/path',
        init: {
            FilesAdded: function(uploader, files) {
                uploader.start();
            }
        }
    });

    $scope.plupload.init();
});

The browse button not working. I've tried to create init function, with no success.

$scope.init = function(){
  $scope.plupload.settings.browse_button = 'browseFileButton';
  $scope.plupload.refresh();
  $scope.plupload.init();
}

Please, any suggestions.

1 Answers1

0

Consider about this article http://benohead.com/angularjs-using-plupload-in-a-dialog/. Use $timeout for init function, something like this in your controller:

$timeout(function(){$scope.plupload.init();},300);

Hope it helps!