Skip to content Skip to sidebar Skip to footer

AngularJS Defer.promise Not Working As Expected

I'm developing an application using AngularJS & PersistenceJS. I'm getting trouble dealing with Asynchronous calls as the Controller : cars.controller('CrashWidgetOneCtrl',

Solution 1:

I dont know if you need the scope.apply. This seemed to work for me:

getCrashDetails:function($scope, crashId){
    var deferred = $q.defer();          
    // Get user details if any
    App.CrashInfoTable.all().list(null, function(results) { 
        deferred.resolve(results);
    });
    return deferred.promise;
}

Post a Comment for "AngularJS Defer.promise Not Working As Expected"