ocombe / ocLazyLoad

Lazy load modules & components in AngularJS
https://oclazyload.readme.io
MIT License
2.63k stars 510 forks source link

URL Parameters stay empties #430

Closed dulcetti closed 6 years ago

dulcetti commented 6 years ago

When I use the ocLazyLoad, the url parameters they are empty. For example, http://localhost:3000/?utm_content=test when open on browser stay http://localhost:3000/

What's happen?

dulcetti commented 6 years ago

The config was:

{
    name: 'foo',
    component: 'foo',
    url: '/',
    lazyLoad: ($transition$) => {
        const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

        return require.ensure([], () => {
            import('./foo.module');

            $ocLazyLoad.load({ name: 'foo.page' });
        }, 'foo.page');
    }
}
dulcetti commented 6 years ago

But now I resolved changing to:

{
    name: 'foo',
    component: 'foo',
    url: '/',
    resolve: {
        load: ($transition$) => {
            const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

            return require.ensure([], () => {
                import('./foo.module');

                $ocLazyLoad.load({ name: 'foo.page' });
            }, 'foo.page');
        }
    }
}