AngularJS templateUrl does not load templates in Internet Explorer 7

According to the header, when I use templateUrl inside my $ routeProvider, the template and controller do not load.

In my configuration, I have:

.when('/thing/:thingId', {
    templateUrl: 'views/things.html',
    controller: 'ThingController'
})

If I changed it to

.when('/thing/:thingId', {
    template: '<div>Hello you!</div>',
    controller: 'ThingController'
})

It works. I am using AngularJS 1.2.2.

Ideas I tried:

  • I tried to add a template to the script tag, which still does not work. I am not getting any errors and since there are no debugging messages in IE. I have a warning that fires when an instance of my controller is created. This does not happen in IE 7 (and probably 8).

  • Added html5shiv, json3 shim, angular -ui ie shiv, and I created all the common elements of the document.

  • I have the following at the top of my site:

    < html class= "ng-app: ThingApp" ng-app = "ThingApp" id = "ng-app" xmlns: ng = "http://angularjs.org" >

    /li >

, , Chrome IE10, IE7 ( IE10, IE7, IE7).

, , .

. , , plunkr , plunkr IE7, , plunkr. , , .

http://plnkr.co/edit/Yswo2QzcwfpzT2PXJV8m

+4
2

, AngularJS 1.2 , IE7. ​​ AngularJS 1.1.5.

0

Angular 1.2+ $sce resourceUrl $sce.trustAsResourceUrl('...') $sce.trustAsResourceUrl('...') IE7 , :

...
templateUrl: $sce.trustAsResourceUrl('/Resource/That/YouTrust.html')
...

document.querySelector , - ( jQuery):

if (!document.querySelector)
{
    document.querySelector = function (selector)
    {
        return $(selector).get(0);
    };
}

Angular ( Angular):

var active = !!(document.querySelector('[ng-csp]') ||
              document.querySelector('[data-ng-csp]'));

, Angular IE, id="ng-app" .

IE7 ;)

: URL

+1

All Articles