我使用Spring服务器作为后端编写带有角度前端的dropzone。我想使用ng-cloak指令:
<body ng-controller="fileCtrl" ng-cloak>
<div class="col-xs-6 col-xs-offset-3">
<div class="well">
<form action="" class="dropzone" dropzone="" id="dropzone">
<div class="dz-default dz-message">
</div>
</form>
</div>
<div class="pull-right">
<button class="btn btn-success" ng-click="uploadFile()">Upload File</button>
<button class="btn btn-danger" ng-click="reset()">Reset Dropzone</button>
</div>
<div>
<form>
<label>File to download</label>
<input ng-model="filename" type="text" placeholder="Filename" />
<a class="btn btn-primary" ng-href="{{ partialDownloadLink + filename }}">Download File</a>
</form>
</div>
</div>
<!-- Load Angular scripts-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.17/angular.min.js"></script>
<script src="js/app.js"></script>
<script src="js/fileAppControllers.js"></script>
<script src="js/fileAppDirectives.js"></script>
<!-- Load Dropzone JS -->
<script src="js/dropzone/dropzone.js"></script>
<script type="text/javascript">
Dropzone.autoDiscover = false;
</script>
</body>
问题是如果我使用ng-cloak指令,身体会消失。 如果我删除display:none;从浏览器中的检查器行,身体出现但是当将文件放入输入区域时,它会闪烁文件。
解决
我忘了放入html标签&#34; ng-app =&#34; fileApp&#34;&#34;。