小编cha*_*ves的帖子

为什么Angular ng-hide无法正确更新

我想通过我控件中的$ scope更新一个名为hideProgressBar的变量,该视图中的指令"ng-hide".但它不起作用.

以下行有效:

$ Scope.hideProgessBar = true;
Run Code Online (Sandbox Code Playgroud)

但下面这行不起作用: 

$ Scope.hideProgessBar = false;
Run Code Online (Sandbox Code Playgroud)

请参阅以下完整代码:

.controller('UltimasEdicoesCtrl', function($scope, $cordovaFileTransfer, $cordovaFileOpener2) {
 $scope.hideProgessBar = true;

    $scope.Download = function () {
        $scope.hideProgessBar = false;
        ionic.Platform.ready(function($scope){

         var url = "http://www.wgontijo.com.br/teste.pdf";
         var filename = url.split("/").pop();
         var targetPath = cordova.file.externalRootDirectory + 'Pictures/' + filename;

          $cordovaFileTransfer.download(url, targetPath, {}, true).then(function (result) {                   
                $cordovaFileOpener2.open(
                     targetPath,
                    'application/pdf'
                  ).then(function() {
                      // file opened successfully
                  }, function(err) {
                      alert('erro ao abrir o arquivo')
                  });  

          }, function (error) {
               alert('Erro ao abrir o arquivo');
          }, …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs ionic-framework

2
推荐指数
1
解决办法
330
查看次数

标签 统计

angularjs ×1

ionic-framework ×1

javascript ×1