I'm picking up Angular JS at: http://www.sitepoint.com/practical-guide-angularjs-directives/, and I find that the following codes work in Chrome, but not IE 11.
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<meta charset="utf-8" />
<title>No Title</title>
<script data-require="[email protected]" src="http://code.angularjs.org/1.2.7/angular.js" data-semver="1.2.7"></script>
</head>
<body>
<input type="text" ng-model="color" placeholder="Enter a color..." />
<div data-hello-world />
<script>
var app = angular.module('myapp', []);
app.directive('helloWorld', function () {
return {
restrict: 'AE',
replace: true,
template: '<p style="background-color:{{color}}">Hello World!!</p>',
link: function (scope, elem, attrs) {
elem.bind('click', function () {
elem.css('background-color', 'white');
scope.$apply(function () { scope.color = "white"; });
});
elem.bind('mouseover', function () { elem.css('cursor', 'pointer'); });
}
}
});
</script>
</body>
</html>
Specifically, the mouseover and click events work fine. However, the paragraph's background color doesn't in IE (the color never changes). It's ok in Chrome. Thanks!
There can be numerous reasons why your Angular application is not working, including: Missing polyfills in polyfills. ts . Using a TypeScript target version which IE11 does not support.
By default, Angular compiles ES6 or ES7. IE 11 only supports ES5.
Angular 13 has dropped support for Internet Explorer 11. This will allow the framework to leverage the features of modern browsers, such as CSS variables and web animation, as well as native web APIs.
AngularJS support has officially ended as of January 2022.
Could be because document compatibility. This worked for me:
Add this tag to web.config.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=10" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
I added the following to the head and it worked. its very similiar to what Mark said...just none asp.net specific:
<meta http-equiv="X-UA-Compatible" content="IE=11" />
i also found i needed to add respond and modernizer in a if statement for older versions of IE:
<!--[if lt IE 9]>
<script src="/Binders/Scripts/modernizr-2.8.3.js"></script>
<script src="/Binders/Scripts/respond.js"></script>
<![endif]-->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With