Skip to content

Problems with $templateCache in oclazyload v.1.0.3 #217

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

Closed
webschik opened this issue Jul 27, 2015 · 6 comments
Closed

Problems with $templateCache in oclazyload v.1.0.3 #217

webschik opened this issue Jul 27, 2015 · 6 comments
Labels

Comments

@webschik
Copy link

Hi!

I'm using ui-router and oclazyload 1.0.2 in my project.

 .state('home.orders', {
            url: '^/orders?{type}',
            reloadOnSearch: false,
            template: '<div data-orders></div>',
            resolve: {
                loadModule: ["$ocLazyLoad", "$injector", ($ocLazyLoad, $injector) => {
                      return $ocLazyLoad.load('myModule');

myModule contains some templates that are used in data-orders directive. After update ocLazyLoad to version 1.0.3 the templates are always loading from server and the next construction

angular.module('myModule').run(['$templateCache', function($templateCache) {
debugger;
....

never runs

@ocombe ocombe added the bug label Jul 27, 2015
@ocombe
Copy link
Owner

ocombe commented Jul 27, 2015

Hmm, any chance to have a plunkr for this please ? :)

@webschik
Copy link
Author

http://plnkr.co/edit/IY36EA

See in console: Error: [$compile:tpload] Failed to load template: template.html (HTTP status: 404 Not Found)

@ocombe
Copy link
Owner

ocombe commented Jul 27, 2015

Thanks, I'll check it out asap

@ocombe ocombe closed this as completed in 52219f9 Jul 30, 2015
@ocombe
Copy link
Owner

ocombe commented Jul 30, 2015

Fixed in 1.0.4, thanks for the report !

@daominhsangvn
Copy link

I thought this issue was happen again.
It's not happen regularly but sometimes. Please see my pictures below with error and without error.
As you can see, the chunk files was loaded correctly.

The error:
2016-09-19_9-53-03

The result it should be:
2016-09-19_9-55-25

My route configuration
2016-09-19_9-56-19

I'm using Angular 1.5.8, angular-ui-router 0.3.1, ocLazyLoad 1.0.9, Webpack 2.1.0-beta.21

@beORIGINAL
Copy link

I also have an issue similar to @daominhsangvn, but with Angular 1.6.0, angular-ui-router 0.3.2, ocLazyLoad 1.0.9, webpack 1.14.0 . It seems to me that rerun and reconfig works a bit incorrect with webpack(I've tried to use 1.0.4 but magic doesn't happen...)? And here - #89, @amaschas also has problems... We definitely believe in your soon fixes!)

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

4 participants