当我在下一页上按住 F5 按钮时,AngularJS 变量会{{message}}
打开{{titleHelp}}
和关闭。
我已经阅读了要删除它的内容,我可以将ng-cloak
其放入正文标签中。然而,这没有任何效果,即它不会停止闪烁。
即使我把它放在这里:
<div ng-cloak>message: {{message}}</div>
该变量仍然闪烁。
我还需要做什么才能使 ng-cloak 起作用?
<html>
<head>
<style type="text/css">
</style>
</head>
<body ng-app="mainModule" ng-controller="dataController" ng-cloak>
<div>message: {{message}}</div>
<div><input type="checkbox" ng-model="desired" ></div>
<div>Title: <input type="text" ng-focus="showHelp()" ng-blur="removeHelp()" ng-model="title"
ng-copy="handleCopy()" /> {{titleHelp}}</div>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src ="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script>
var mainModule = angular.module('mainModule', []);
function dataController($scope) {
$scope.desired = true;
$scope.message = 'This is a test.';
$scope.showHelp = function () {
$scope.titleHelp = 'this is the title help';
};
$scope.removeHelp = function () {
$scope.titleHelp = '';
};
}
</script>
</body>
</html>