angular-flickity icon indicating copy to clipboard operation
angular-flickity copied to clipboard

IE11 ReferenceError: 'Promise' is undefined

Open isherwood opened this issue 8 years ago • 6 comments

This error occurs for me in IE11.

ReferenceError: 'Promise' is undefined at create (https://dev7.atomiclearning.com/static/js_apps/main/node_modules/angular-flickity/dist/angular-flickity.js:161:14) at Anonymous function (https://dev7.atomiclearning.com/static/js_apps/main/node_modules/angular-flickity/dist/angular-flickity.js:948:14) ...

Research indicates that the module might rely on Promise, which is not supported by IE11. Was it intended that a polyfill be used? Why wasn't $q used instead?

isherwood avatar May 04 '17 20:05 isherwood

I've added a polyfill for Promises:

<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise"></script>

The page loads extremely slowly, though, and the slide animation is also very slow and jerky. Possibly related is the fact that the demos don't work in IE.

isherwood avatar May 08 '17 15:05 isherwood

Hey @isherwood, when this was being built IE was not a target browser. The core Flickity library does support IE10+ so IE support would be a good addition.

I've recently started a new role so my time is extremely tight right now so I can't say if/when I could refactor this. :/ More than open to PRs though if the polyfill isn't cutting it for you.

benjamincharity avatar Jun 02 '17 19:06 benjamincharity

I completely understand. Not to derail anyone, but I ended up writing a simple directive that is working well in IE11:

        .directive('myFlickity', function ($timeout) {
            return {
                restrict: 'A',
                link: function (scope, element, attrs) {

                    // wait for the ngRepeat stuff to get set up
                    $timeout(function () {
                        // register DOM listeners and update the DOM
                        var slider = element.flickity(scope.$eval(attrs.alFlickity));

                         // grab the Flickity data object for later use
                        var sliderData = slider.data('flickity');
                    });
                }
            };

I was able to improve performance by simplifying my markup structure. IE is still much slower than other browsers, but it's tolerable. IE is dying anyway.

isherwood avatar Jun 02 '17 19:06 isherwood

+1 IE 10+ support would be great. I'll use the polyfill for now thanks :)

adrienlamotte avatar Jul 19 '17 08:07 adrienlamotte

I had an issue with IE11 -> 'Promise' is undefined Just used $q instead.

Worked for me

akhlopyk avatar Jun 12 '18 15:06 akhlopyk

I'm having the same issue. @akhlopyk. Can you please how you ended up fixing it? Thanks for your help.

parmarsanjayCLS avatar Jan 23 '19 04:01 parmarsanjayCLS