angularjs-breakpoint
angularjs-breakpoint copied to clipboard
Reserved word "class" breaks ie8 usage
FYI, "class" is a reserved word in ie8 so breakpoint.class causes an error. It's easy to get around this by using breakpoint['class'], but might be good to point this out in the "Events" portion of the docs to avoid tears. The library also breaks in ie8 because of this issue when pulling in through bower though, so I would suggest using the above work around or not using the word class in the library. (If you want to support ie8 that is, which I can understand if you don't)
To support IE8:
Change 'class' to 'klass' in applicable areas and then:
scope.breakpoint.windowSize = $window.innerWidth;
to
scope.breakpoint.windowSize = $window.innerWidth || $document[0].documentElement.clientWidth || $document[0].body.clientWidth;
Since IE8 does not have innerWidth.