我想通过我控件中的$ 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)