angularJs检测单击页面上的任何位置并仅在IE9中更新模型

时间:2014-04-15 16:29:40

标签: javascript angularjs internet-explorer-9

我制作了一个自定义手风琴模板:

<div class="left_pane" ng-style="{height : mapStyle.height-82+'px'}">
            <div class="accord_main_wrap">
                <div class="accord_item_wrap" ng-repeat="head in heads">
                    <p class="accord_head" data-notvisible="true">{{head.text}}</p>
                    <div class="accord_content_wrap">
                        <ul>
                            <li ng-model="sub.text" ng-repeat="sub in head.subs">
                                    <label>
                                        <input type="checkbox" ng-model="sub.isChecked"/>
                                        <span class="accordSubs">{{sub.text}}</span>
                                    </label>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

我有一个模型,其中包含复选框的状态。

问题是当用户点击页面上的任何位置时,第一个复选框会更新/切换(true / false)。

此行为仅在IE9中出现。 上面的IE9还可以,FF和Chrome都可以。

我在我的智慧结束,真的需要帮助。

编辑:随附模型

[{
    "id": "3",
    "text": "Main Title One",
    "subs": [{
        "id": "5",
        "text": "Sub Title One",
        "isChecked": false,
        "headId": "3",
        "headTitle": "Main Title One",
        "$$hashKey": "00E"
    },
    {
        "id": "6",
        "text": "Main Title One",
        "isChecked": false,
        "headId": "3",
        "headTitle": "Sub Title Two",
        "$$hashKey": "00F"
    }],
    "$$hashKey": "004"
},
{
    "id": "4",
    "text": "Main Title Two",
    "subs": [{
        "id": "7",
        "text": "Sub Title One",
        "isChecked": false,
        "headId": "4",
        "headTitle": "Main Title Two",
        "$$hashKey": "00A"
    },
    {
        "id": "9",
        "text": "Sub Title Two",
        "isChecked": false,
        "headId": "4",
        "headTitle": "Main Title Two",
        "$$hashKey": "00B"
    }],
    "$$hashKey": "005"
}]

0 个答案:

没有答案