-
Notifications
You must be signed in to change notification settings - Fork 27.4k
refactor: use document.documentMode to determine msie version #9398
Conversation
4aea500
to
ef5d3ea
Compare
I am a fan of this approach (vs. UA sniffing) |
There are various places still in the code that actually test the numeric value of https://github.com/angular/angular.js/blob/master/src/ng/compile.js: https://github.com/angular/angular.js/blob/master/src/ng/directive/a.js: https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js: https://github.com/angular/angular.js/blob/master/src/ng/sanitizeUri.js: https://github.com/angular/angular.js/blob/master/src/ng/sniffer.js: https://github.com/angular/angular.js/blob/master/src/ngScenario/browserTrigger.js: https://github.com/angular/angular.js/blob/master/src/ngScenario/dsl.js: https://github.com/angular/angular.js/blob/master/test/AngularSpec.js: https://github.com/angular/angular.js/blob/master/test/jqLiteSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/compileSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/directive/aSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/directive/booleanAttrsSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/directive/formSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/directive/inputSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/directive/ngRepeatSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/httpBackendSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/httpSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/locationSpec.js: https://github.com/angular/angular.js/blob/master/test/ng/snifferSpec.js: https://github.com/angular/angular.js/blob/master/test/ngMock/angular-mocksSpec.js: There is a unit test to remove to: https://github.com/angular/angular.js/blob/master/test/AngularSpec.js: Also https://github.com/angular/angular.js/blob/master/src/ng/sce.js: |
LGTM |
1 similar comment
LGTM |
@petebacondarwin |
Yeah I get it now. I didn't check what documentMode actually was before
|
documentMode is available since Internet Explorer 7 (it has recently been deprecated but is still available). It will always return the rendering mode, so if you use Internet Explorer 11 in IE9 mode it will return 9. That's probably event better than what happens now. |
Makes me think that it would be nice if AngularJS had embedded $browser service, so it could be used by the library internally and by the client's code where needed - all in the same consistent way. |
No description provided.