国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

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

angular.js - angular 視圖未更新

瀏覽:203日期: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(); }}

相關文章:
主站蜘蛛池模板: 宜兰县| 栾川县| 东乌| 秭归县| 双峰县| 永兴县| 乌审旗| 昌吉市| 石狮市| 临漳县| 青河县| 耿马| 富民县| 保山市| 登封市| 宁海县| 明星| 新兴县| 盘锦市| 丹棱县| 岗巴县| 潞城市| 博罗县| 名山县| 元江| 德令哈市| 定边县| 奉新县| 河南省| 东兰县| 诸城市| 射阳县| 顺平县| 翁牛特旗| 和龙市| 东兴市| 文山县| 新乡县| 黎城县| 清苑县| 德州市|