castillo-io / angular-css

CSS on-demand for AngularJS [Looking for New Maintainers]
http://castillo-io.github.io/angular-css/#/
MIT License
470 stars 86 forks source link

got problem in IE9 #52

Closed xuyukuan closed 7 years ago

xuyukuan commented 8 years ago

I've tried this in my project, but unfortunately, it will throw "invalid arguments" error in IE9. I do some analysis and want to confirm my guess:

  1. I use jquery 1.11.3
  2. I use angularjs 1.4.7
  3. I use angular-ui-router v0.2.15

I config the css like this:

 $stateProvider.state('home', {
      url: '/home',
      template: require('./views/home.html'),
      css: 'assets/home.css'
    })

the error occurred when jquery try to set href for the link dom element. I guess it happens when the template is compiled.(below code is from $set method in angularjs)

this.$$element.attr(attrName, value);

at this moment, attrName is 'href', value is 'assets/home.css'. then I debug into jquery, then the error will throw at this line in jquery:

elem.setAttribute( name, value + "" );

then I found this: http://stackoverflow.com/questions/1184950/dynamically-loading-css-stylesheet-doesnt-work-on-ie

it seems this link explain why the error happen in IE9. I guess it's because in angular-css, the template is compile first and then append to head, but it seems IE9 doesn't support this.

But angular-css's doc says it support IE9, So I'm doubt my analysis and just want to confirm it. and figure out why I get the error here. Hope get some help from your guys :), thanks in advance.

glaggia-larus commented 7 years ago

In my own opinion: consider drop support for IE9, if you can

xuyukuan commented 7 years ago

Thanks @glaggia-larus