angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.82k stars 27.5k forks source link

angularjs1.2.0-rc.3 regression: JQLite[...]Class functions do not work in IE7 #4562

Closed fbenz closed 10 years ago

fbenz commented 11 years ago

This is a regression from RC2 to RC3. The functions JQLiteHasClass, JQLiteAddClass, JQLiteRemoveClass do not work anymore in IE7 because they use setAttribute and getAttribute. One of the results is that ng-show does not work in IE7.

The issue has been introduced by commit c785267eb8780d8b7658ef93ebb5ebddd566294d

Commit 64fd2c421ed582c16812d164a8a6f031b8e66287 is related as it adds checks for the existance of getAttribute or setAttribute function does exist.

nosideeffects commented 11 years ago

I know that in the past AngularJS has somewhat functioned properly IE7, if you polyfilled the appropriate methods and wrote your app a certain way.

However, it does not officially attempt to support IE7. If you need your Angular application to continue to function in IE7, override these particular functions yourself or include jQuery 1.x.

fbenz commented 11 years ago

I found no statement on the support of IE versions. The only thing that is made clear is that one needs some extra steps to run Angular apps in IE8 or earlier. If something like ng-show does not work in IE7 anymore, I would appreciate a clear statement in the documentation that AngularJS does not work with IE7.

We are using jQuery 1.x. But as the JQLite[...]Class functions are used directly and are therefore not replaced by the jQuery counterparts, loading jQuery before does not help.

I see two issues here:

  1. The direct use of the jqLite functions internally. For me this is against the intention behind jqLite, namely that it is only there to avoid a strict dependency on jQuery. From the documentation: "jqLite is a tiny, API-compatible subset of jQuery that allows Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most commonly needed functionality with the goal of having a very small footprint."
  2. jqLite functions that do not support IE7 anymore. I cannot argue against this one if IE7 is not supported.
nosideeffects commented 11 years ago

From the FAQ:

What browsers does Angular work with?

We run our extensive test suite against the following browsers: Safari, Chrome, Firefox, Opera, IE8, IE9 and mobile browsers (Android, Chrome Mobile, iOS Safari).

If you look at the source, they do not run tests against IE7, either. IE7 and IE7 standards mode in IE8+ will likely to continue to break in the future, since it is not part of the test suite and unlikely to be re-added. I am simply trying to let you know that if you truly want/need IE7 support, providing the necessary testing/fixes will be up to you and others in your position.

fbenz commented 11 years ago

Thank you, I somehow missed that FAQ entry when scanning the documentation. We are planning on dropping IE7 support for our site, but until that happens I have to do some extra work.

nosideeffects commented 11 years ago

Good luck! Hopefully IE7 won't be your problem for much longer!

grantyb commented 10 years ago

I've just encountered this issue. Is there a workaround? We should add this IE7 caveat to the http://docs.angularjs.org/guide/ie documentation, especially if there's a solution (other than using ng-if instead of ng-show and ng-hide).

fbenz commented 10 years ago

Currently, we use a patch that basically reverts https://github.com/angular/angular.js/commit/c785267eb8780d8b7658ef93ebb5ebddd566294d Thus, the patch breaks the SVG test, but we do not use this functionality.

However, we decided to do no further patching and show a message to IE7 users. This works in our case, because we only use AngularJS to add features to existing sites.

scottywakefield commented 10 years ago

@fbenz - thanks for the heads up

btford commented 10 years ago

We don't support IE7.