久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

angular.js - angular 視圖未更新

瀏覽:199日期:2024-10-02 15:08:52

問題描述

angular.js - angular 視圖未更新

angular.js - angular 視圖未更新

如圖 選擇文件上傳后,Input內會有文件路徑對應顯示,過程中不點擊上傳按鈕,這時點擊取消窗口后,再次打開,文件路徑依舊存在。

$(’.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();}}

點擊取消時,Input內以為空, console.log其值也為空。

是否使用$scope.$apply? 并且在哪里使用?

問題解答

回答1:

$(’.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();}}回答2:

$(’.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(); }}

相關文章:
主站蜘蛛池模板: 安丘市| 祁门县| 临朐县| 仁化县| 忻城县| 临泽县| 通州区| 宁夏| 广南县| 屯门区| 滦南县| 安塞县| 开封县| 搜索| 甘泉县| 曲松县| 诸暨市| 邯郸县| 霍邱县| 民勤县| 仙游县| 南召县| 新津县| 巨鹿县| 平陆县| 南京市| 登封市| 南召县| 宜春市| 咸丰县| 兖州市| 于都县| 浦东新区| 神农架林区| 洛扎县| 芮城县| 靖远县| 枝江市| 柳江县| 儋州市| 卓资县|