What am I doing wrong here? I've read through the IE Compatibility Guide but that doesn't mention data binding using {{}} tags. This works fine on other browsers but fails in IE (including IE9).
/
HTML:
<html ng-app class="ng-app">
<head></head>
<body>
<div ng-controller="Controller">
<p>{{test}}</p>
</div>
</body>
</html>
JavaScript:
function Controller($scope) {
$scope.test = "Hello world";
}
I've tried adding the steps mentioned in the patibility guide but that doesn't seem to solve it, unless I'm missing something obvious!
It should output "Hello world", but on IE it outputs {{test}}.
Many Thanks.
What am I doing wrong here? I've read through the IE Compatibility Guide but that doesn't mention data binding using {{}} tags. This works fine on other browsers but fails in IE (including IE9).
http://jsfiddle/yMgQ8/1/
HTML:
<html ng-app class="ng-app">
<head></head>
<body>
<div ng-controller="Controller">
<p>{{test}}</p>
</div>
</body>
</html>
JavaScript:
function Controller($scope) {
$scope.test = "Hello world";
}
I've tried adding the steps mentioned in the patibility guide but that doesn't seem to solve it, unless I'm missing something obvious!
It should output "Hello world", but on IE it outputs {{test}}.
Many Thanks.
Share Improve this question edited Oct 29, 2013 at 18:29 James Donnelly asked Aug 16, 2012 at 9:25 James DonnellyJames Donnelly 129k35 gold badges214 silver badges223 bronze badges 5-
1
Looks right. Have you tried it outside jsfiddle in a file with a
<!doctype html>
tag? – hyperslug Commented Aug 16, 2012 at 11:41 - Yep, the document I have it in has correct doctype set up. Other AngularJS functions work fine (it loads a JSON file with no hitches), but when trying to display data with curly braces it just fails for IE. – James Donnelly Commented Aug 16, 2012 at 11:57
-
<!doctype html>
worked for me but make sure you don't have any ments above it see this post for more info: stackoverflow./a/7312841/1207991 – Gloopy Commented Aug 16, 2012 at 17:58 - I have <!doctype html> at the top of the document with no ments beforehand. – James Donnelly Commented Aug 17, 2012 at 10:57
- I am having the same issue in MSIE 7/8 did you ever figure out what was wrong? – DrogoNevets Commented Dec 3, 2013 at 10:32
2 Answers
Reset to default 3The problem appears not to be angular but jsfiddle
http://plunker.no.de/BL97Av/ this works in IE9
Also, IE7 or IE8 Compatibility you are on your own.
For future reference; adding an id attribute to the html element solved my problem. In your case this would mean changing the code to:
<html ng-app id="ng-app" class="ng-app">