我曾尝试以下,但使用时,我仍然得到一个闪烁NG-显示:Angularjs - ng-cloak/ng-show elements blink伍秀引起闪烁
我使用的模板如下加载我的顶部导航:
<div data-ng-controller="userInfoCtrl">
<a href="#!home">Home</a>
<a href="#!add-item">Add Item</a>
<a href="#!settings" data-ng-show="display">Settings</a>
这里是我的控制器:
// User Info
appControllers.controller('userInfoCtrl', ['$scope', 'appAdminCheck', function ($scope, appAdminCheck) {
// Set value for using ng-show/ng-hide
appAdminCheck().then(function (isAdmin) {
if (isAdmin == true) {
$scope.display = true;
}
});
}]);
向我们展示更多的代码。这是不够的。 ng-show在哪里? – squiroid 2015-03-25 05:00:47
@squiroid那里''Settings不 – 2015-03-25 05:13:33
'display'已设置为false最初,或使用NG-如果将解决您的问题.. – 2015-03-25 05:13:34