Angular ng-click指令在IE 11中不起作用

时间:2015-11-11 17:05:58

标签: javascript angularjs internet-explorer-11

我遇到一个问题,即除了IE10和11之外,所有浏览器都可以使用简单的ng-click功能(还没有能够检查Edge。)

这是指令:

$scope.showMoreDetails = false;
  $scope.toggleMoreDetails = function() {
    $scope.showMoreDetails = !$scope.showMoreDetails;
  };

这就是电话:

<a data-ng-if="!showMoreDetails" data-ng-click="toggleMoreDetails()"></a>
<a data-ng-if="showMoreDetails" data-ng-click="toggleMoreDetails()"></a>

感谢您的帮助,我现在已经结束了。

2 个答案:

答案 0 :(得分:0)

Probably because you need a valid href in your anchor tag

答案 1 :(得分:0)

Your tags should look like this:

<a href="" data-ng-if="!showMoreDetails" data-ng-click="toggleMoreDetails()"></a>
<a href="" data-ng-if="showMoreDetails" data-ng-click="toggleMoreDetails()"></a>