Promise not defined in ionic.bundle.js:11731


#1

I’m getting, on Android 4.2.2 (Asus nexus 7):

Uncaught ReferenceError: Promise is not defined at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:11731

ionic.bundle.js: version: ‘1.0.0-beta.11’

Please LMK what other info I should provide.

I’m also new to Promises. I’m trying to do something like this in my utility.js:

'use strict';

angular.module('boosterapp.utility', [])

.service('Utility', function($ionicPopup, $q, Promise, $rootScope, $state, Booster) {

var self = this;    
this.asyncLoginRegister = new Promise(function(resolve, reject)
{
    var d = $q.defer();
    console.log('asyncLoginRegister');
    return self.asychGetLoginStatus()
    .then(function(result){
        return self.asynchFacebookLogin()
    })//..
});

More context code: https://gist.github.com/adaptivedev/80d12675ba1e83d424b1

Thanks for your help!


#2

In ionic.bundle.js at line 11731, in function createInternalInjector, there is “throw err”: https://gist.github.com/adaptivedev/4d2404cf36256bb749f4

I see all references to Promise in ionic.bundle as lower-case, so:
I changed my client code from using “new Promise” to “new promise”

And now I get this:

09-09 11:14:09.796: E/Web Console(4270): Uncaught Error: [$injector:unpr] Unknown provider: PromiseProvider <- Promise <- Utility
09-09 11:14:09.796: E/Web Console(4270): http://errors.angularjs.org/1.2.17/$injector/unpr?p0=PromiseProvider%20<-%20Promise%20<-%20Utility at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:11731