angular.js - angular view not updating
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-15 17:03:00
0
2
581

As shown in the figure, after selecting the file to upload, the file path will be displayed correspondingly in the Input. If you do not click the upload button during the process, click Cancel window and open it again, and the file path will still exist.

$('.part1_top_right').click(function(){
            $('.part1').hide();
            $('.part2').hide();
            $('.part3').hide();
            $('.part4').hide();
            $('.part5').hide();
            
            $scope.filePath="";
            
            $scope.cleanSelectFiles();
        });
$scope.cleanSelectFiles = function(){
            if(uploader.queue.length > 0){
                uploader.clearQueue();
                

                
                                
            }
        }

When you click Cancel, the Input is empty and the value of console.log is also empty.

Use $scope.$apply? And where?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
迷茫

$('.part1_top_right').click(function(){
            $('.part1').hide();
            $('.part2').hide();
            $('.part3').hide();
            $('.part4').hide();
            $('.part5').hide();
            
            $scope.filePath="";
            $scope.$apply();
            $scope.cleanSelectFiles();
        });
$scope.cleanSelectFiles = function(){
            if(uploader.queue.length > 0){
                uploader.clearQueue();
                

                
                                
            }
        }
習慣沉默
$('.part1_top_right').click(function(){
    $('.part1').hide();
    $('.part2').hide();
    $('.part3').hide();
    $('.part4').hide();
    $('.part5').hide();
    
    $scope.filePath="";//这就是你的input?如果是,那$apply在这就行
    $scope.$apply();
    
    $scope.cleanSelectFiles();
});

$scope.cleanSelectFiles = function(){
    if(uploader.queue.length > 0){
        uploader.clearQueue();
        

        
                        
    }
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template