Angular $q .catch() method fails in IE8

前端 未结 3 923
旧时难觅i
旧时难觅i 2021-01-31 08:52

I\'m experiencing a weird bug on IE8 while trying to catch a promise reject (promise returned by a basic ngResource call) :

This code work with .then(

3条回答
  •  没有蜡笔的小新
    2021-01-31 09:51

    http://docs.angularjs.org/api/ng/service/$q#the-promise-api

    Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise'finally' to make your code IE8 and Android 2.x compatible.

    Same for catch.

提交回复
热议问题