Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resovle request, which was failed. #189

Closed
Dryymoon opened this issue May 28, 2015 · 7 comments
Closed

Resovle request, which was failed. #189

Dryymoon opened this issue May 28, 2015 · 7 comments
Labels

Comments

@Dryymoon
Copy link

If occurred some error in resolve request, for example - server is unrechable, ocLazyLoad return deferred.reject;
But in future, even if server is reachable, if some module rerequest same dependencies, it will immidiately returned as rejected.

reject come from ocLazyLoad.js:803:37
@Version v1.0.0-beta.2

This is a Bug or a Hint? And how I can redefine this beahiour - if the request failed,with the second same request was an attempt to resolve it.

@ocombe
Copy link
Owner

ocombe commented May 28, 2015

hu that's really not what is supposed to happen. I wonder if it's because the browser caches the error and returns it everytime after that ?

@Dryymoon
Copy link
Author

No, Browser don`t cache. I tested on several browsers, - Chrome with cache disabled, Firefox.. maby caching requests, Opera with cache disabled, MS IE not tested. I created custom function thet call $http.get request with same file, and it resolved normaly.

@ocombe
Copy link
Owner

ocombe commented May 28, 2015

Ok, I'll check it out then, it's probably some internal caching inside the lib then :)
If you have a working use case (code or plunkr) it would help !

@Dryymoon
Copy link
Author

I can`t simulate this on plunkr because for investigate the problem we need to manage network or server for become unreachable... but...

Some code:
JS:

angular
  .module('app', ['ui.router','oc.lazyLoad']);

angular.module('app')
  .config(
    [          '$stateProvider', '$urlRouterProvider',
      function ( $stateProvider,   $urlRouterProvider ) {
        $stateProvider
            .state('sign', {
              templateUrl: 'components/login/views/login.main.html',
              }
            })
.state('sign.forgotPassword', {
              url: '^/forgot-password',
              templateUrl: 'part.forgot-password.html',
              resolve: {
                deps: ['$ocLazyLoad',
                  function( $ocLazyLoad ){
                    return 
$ocLazyLoad.load(['components/login/scripts/forgotPasswordCtrl.js']);
/* This is where a bug */
                }]
              }
            });

HTML (login.main.html):

     <a ui-sref="sign.forgotPassword">Test</a>

@ocombe
Copy link
Owner

ocombe commented May 28, 2015

Thanks, that should do it

@ocombe ocombe closed this as completed in 9a186c9 May 29, 2015
@ocombe
Copy link
Owner

ocombe commented May 29, 2015

Fixed!
It's weird that no one else ever reported this, because this bug was probably here since a really long time :)

@ocombe ocombe added the bug label May 29, 2015
@wuyuedefeng
Copy link

I also met the same problem, have to solve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants