Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $window.attachEvent instead of $window.addEventListener on IE8 #11

Closed
wants to merge 1 commit into from
Closed

Use $window.attachEvent instead of $window.addEventListener on IE8 #11

wants to merge 1 commit into from

Conversation

flocca
Copy link

@flocca flocca commented Sep 16, 2013

This is a fix to make localStorage work properly on IE8.

window.addEventListener doesn't exists in IE8, use window.attachEvent instead.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener

@gsklee
Copy link
Owner

gsklee commented Sep 17, 2013

Hi @flocca, thanks for the PR! Unfortunately I have no intention to support nonstandard legacy methods, so the only way I can accept it is if you can change L94 to the following or something similar:

'localStorage' === storageType && $window.addEventListener && $window.addEventListener('storage', function(event) {

This should make the module working properly in IE8 except the extra benefit of sync'ing between tabs.

@gsklee gsklee mentioned this pull request Oct 15, 2013
@gsklee gsklee closed this in 2f36c9c Oct 15, 2013
@blowsie
Copy link

blowsie commented Sep 24, 2014

Am I right in thinking ngstorage supports Angular 1.2 but not IE8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants