Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fallback support for javascript promises [closed]

Our web app uses Angular JS and it's built in $http module. Javascript promises are great... but we need to support a kiosk display running Android 4.2 which doesn't support promises (according to this).

Are there shims to make these newer libraries compatible with browsers that don't support promises?

like image 624
emersonthis Avatar asked Apr 27 '26 01:04

emersonthis


1 Answers

AngularJS already has built-in support for promises, regardless of what the host browser supports. See the Angular JS doc for this.

So, you can use the Angular version of promises in any browser, regardless of what promise support the host browser has or doesn't have. Angular had to do this for their own use because they wanted to use promises, but all installed browsers they wished to run in do not have promise support built-in yet.


If there was some reason you wanted a promise library independent of what AngularJS already offers or one with more capabilities, there are many 3rd party libraries available that can be added to any project. I have the most experience with Bluebird (which I use for node.js developement), but there are others like Q, RSVP and When and a whole list here.

like image 101
jfriend00 Avatar answered Apr 28 '26 14:04

jfriend00