I am using the window object and a defer in order to inject some content into my controller that is not available at the time i create it. This is working fine the first time i call it - the .then method is being executed just fine. But when i call it subsequent times the .then method is not firing. What could cause this?

```
app.factory('fromoutside', function ($window, $q, $rootScope) {
    var deferred = $q.defer();

    $window.injectIntoAngularWorld = function (obj) {
        deferred.resolve(obj);
        $rootScope.$apply();
    };

    return deferred.promise;
});

```

This is a fiddle that sort of simulates what i'm doing but not exactly. It throws errors about apply already in progress, but then again, i get those alot and ignore them quite often [fiddle](http://jsfiddle.net/Vbahole22/Dw2Tg/)