久久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(); }}

相關文章:
主站蜘蛛池模板: 东莞市| 钦州市| 奇台县| 宝山区| 仲巴县| 收藏| 芦溪县| 漯河市| 高州市| 三门峡市| 马尔康县| 中宁县| 灌阳县| 那坡县| 大同县| 永昌县| 瑞安市| 含山县| 万山特区| 平乐县| 麻阳| 岑溪市| 荃湾区| 含山县| 仪陇县| 离岛区| 大庆市| 田林县| 林芝县| 鹤庆县| 华阴市| 留坝县| 久治县| 恭城| 轮台县| 皮山县| 云南省| 双桥区| 衡阳市| 遂宁市| 应用必备|