NG-点击IE浏览器中不工作,但在Chrome中工作正常 [英] ng-click not working in IE but works fine in CHROME

查看:268
本文介绍了NG-点击IE浏览器中不工作,但在Chrome中工作正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <从多个=多​​个名=名单NG模型=selectedVal&GT选择ID =;
    < OPTGROUP标签={{geo.Geo}}NG重复=Geo在地理学>
        <选项ID ={{country.CountryKey}}NG重复=国geo.CountryNG点击=arrayPush()> {{country.CountryDescription}}< /选项>
    < / OPTGROUP>
< /选择>

arrayPush(),当我点击一个特定的选项没有被称为

  $ scope.arrayPush =函数(){警报(你好!);}


解决方案

我刚发现时的回答我的问题。

 <从多个=多​​个名=名单NG模型=selectedValNG变化=arrayPush()&GT选择ID =;
    < OPTGROUP标签={{geo.Geo}}NG重复=Geo在地理学>
        <选项ID ={{country.CountryKey}}NG重复=国geo.Country> {{country.CountryDescription}}< /选项>
    < / OPTGROUP>
< /选择>

在选择

而不是使用的NG-点击,使用选择的NG-模型和NG-变化。工作在两个Chrome和IE

<select id="from" multiple="multiple" name="list" ng-model="selectedVal">
    <optgroup label= "{{geo.Geo}}" ng-repeat="geo in Geographies"> 
        <option id="{{country.CountryKey}}" ng-repeat="country in geo.Country" ng-click="arrayPush()">{{country.CountryDescription}}</option>   
    </optgroup>
</select>

arrayPush() is not being called when I am clicking a specific option

$scope.arrayPush = function(){alert("Hello!");}

解决方案

I just found-out the answer to my question

<select id="from" multiple="multiple" name="list" ng-model="selectedVal" ng-change="arrayPush()">
    <optgroup label= "{{geo.Geo}}" ng-repeat="geo in Geographies"> 
        <option id="{{country.CountryKey}}" ng-repeat="country in geo.Country" >{{country.CountryDescription}}</option>   
    </optgroup>
</select>

Instead of using ng-click in option, use an ng-model and ng-change in select. Works in both Chrome and IE

这篇关于NG-点击IE浏览器中不工作,但在Chrome中工作正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆