0

JSON:

[
  {
    "1": "January",
    "2": "February",
    "8": "August",
    "9": "Septemeber",
    "10": "October",
    "11": "November",
    "12": "December"
  },
  {
    "2": "February",
    "3": "March",
    "4": "April",
    "5": "May",
    "6": "June",
    "7": "July",
    "8": "August"
  }
]

HTML:

<select class='W1_Normal V4 A_{{$parent.$index}}' style="width:100px;" id="A_{{$parent.$index}}_{{$index}}"  name="A_{{$parent.$index}}_{{$index}}" onchange="modifiyOtherDropDowns(this);removeErrorMessagesOfAllLowerDivsUsingObj(this)">
    <option value=""></option>
    <option ng-repeat="(key, value) in ap" value="{{key}}">{{value}}</option>
</select>

In Firefox and Chrome, above written code is working fine, {{value}} is getting resolved corresponding value. But in IE {{value}} is getting showed as {{value}}!

UPDATE:Problem specific to IE8

enter image description here

Rishi
  • 1,646
  • 2
  • 15
  • 34
  • Don't use ngRepeat to build selects, use [ngOptions](https://docs.angularjs.org/api/ng/directive/select). – Yoshi Sep 13 '14 at 10:09
  • You can use ng-class to bind a model to a css class. Does IE show a javascript error in F12 ? – jao Sep 13 '14 at 10:10
  • 1
    Have you checked all the steps in here https://docs.angularjs.org/guide/ie – Joao Leal Sep 13 '14 at 10:11
  • @Yoshi I know,I made a mistake by using ng-repeat. But does this have any concern with the issue I am facing? – Rishi Sep 13 '14 at 10:16
  • @jao yes ,It is showing some error "Object doesn't support this property or method" ,I am digging deeper in the issue ,thanks for pointing out. – Rishi Sep 13 '14 at 10:19
  • 1
    IE compatibility mode might be the problem. http://stackoverflow.com/questions/3449286/force-ie-compatibility-mode-off-in-ie-using-tags – Steve Lang Sep 13 '14 at 10:36
  • @RishiPrakash To be honest, I wouldn't even bother checking. Just use ngOptions. – Yoshi Sep 13 '14 at 10:58
  • @Yoshi how can I have key,value as value,text in ng-options?? – Rishi Sep 13 '14 at 11:07
  • @Yoshi http://stackoverflow.com/a/21734643/3956550 this is the reason I used ng-repeat. :) – Rishi Sep 13 '14 at 11:13
  • @Yoshi Well,what u suggested worked. But If I have to use ng-repeat ,will there be any suggestion to support this problem in IE8 too? – Rishi Sep 16 '14 at 10:54

1 Answers1

0

You should read this article about using Angular with IE8 and earlier. There are some tricks you need to know about. Whenever I target IE8 with Angular, I avoid writing element directives and stick with attribute directives instead.

Ahmer
  • 94
  • 5
  • I agree with you ,but this doesn't provide an answer to my Qus. – Rishi Sep 13 '14 at 10:56
  • i think in this link point number 4 is the answer of your question – Ahmer Sep 14 '14 at 13:01
  • Yes Ahmer,it does. But see using ng-repeat is also the right way to do. It's IE8 Engine which have some bug in it ,that why it doesn't render {{variable}} properly. – Rishi Sep 16 '14 at 10:55
  • instead of ng-repeat try `ng-options` [click here](https://docs.angularjs.org/api/ng/directive/select) to view more detail – Ahmer Sep 16 '14 at 15:43