【发布时间】:2016-08-03 13:57:39
【问题描述】:
在我的代码中,ng-show 在 Firefox 而不是 IE 11 上运行良好。
<div ng-show="isExist" class="panel panel-default">
在控制器中
$scope.isExist = false;
if(user.name)
{
$scope.isExist = true;
}
我得到 $scope.isExist 为 false 并且 Div 在 ff/chrome 上隐藏,但在 ie11 上没有。
【问题讨论】:
-
您是否进行了任何调试以确认
user.name和$scope.isExists是您所期望的所有三种浏览器中的内容? (需要包含在您的问题中) -
您检查过 IE 开发者工具中的错误吗? user.name 的值正确吗?
-
@KevinB ,我已经在所有三个浏览器上进行了调试,我得到 $scope.isExist 的最终值为 false。但是 IE11 在使用 ng-show 时表现不同。
-
@RicardoPontual 是的,我已经使用 IE 浏览器的开发工具进行了调试,并且与其他浏览器开发工具的值一样,isExist 的值为 false。 div 在 FF 或 Chrome 上被隐藏。
标签: javascript angularjs html css angularjs-directive