6

在 IE8 中使用 Angular-UI 引导手风琴时,选项卡不会展开。这是我使用 IE 8 的 F12 收到的错误

 Error: Unexpected call to method or property access.undefined 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 
 Error: No controller: accordion<div class="accordion-group ng-scope" ng-repeat="c in categories" heading="{{c.Name}}"> 

有没有人遇到过类似的问题并能够解决?

4

3 回答 3

6

看起来主要问题是 IE 不喜欢<accordion>使用<div accordion></div>

于 2013-03-21T19:54:00.727 回答
4

IE8 无法识别自定义元素。如果您需要将该accordion指令用作元素而不是属性,则必须定义该元素,以便 IE 不会抱怨。这个简单的脚本可以解决问题。

<script type="text/javascript">
    document.createElement('accordion');
    document.createElement('accordion-group');
    document.createElement('accordion-heading');
</script>

否则,只需以其属性形式使用该指令。

于 2013-12-13T13:53:20.123 回答
1

我刚刚遇到的另一个问题是您不能将 ng-controller 放在与 ie8 相同的元素上<div accordion>。我花了很多时间来弄清楚这一点。

我不得不更换

<div accordion ng-controller="MyCtrl">
    ...
</div>

<div ng-controller="MyCtrl">
    <div accordion>
        ...
    </div>
</div>
于 2013-10-14T20:56:21.747 回答