Fix refresh of User Details page
@@ -200,20 +200,23 @@ class Route {
url: '/users',
lazyLoad: (transition: any) => {
const $ocLazyLoad = transition.injector().get('$ocLazyLoad');
+ const onModuleLoad = () => {
return import(/* webpackChunkName: "admin.auth.module" */ "./auth/module")
- .then(mod => {
- $ocLazyLoad.load({name: mod.default.module.name}).then(function success(args: any) {
- //upon success go back to the state
- $stateProvider.stateService.go('users')
- return args;
- }, function error(err: any) {
- console.log("Error loading users ", err);
- return err;
- });
- })
- .catch(err => {
- throw new Error("Failed to load ./auth/module, " + err);
+ .then(Lazy.onModuleFactoryImport($ocLazyLoad)).then(Lazy.goToState($stateProvider, "users", transition.params()));
+ };
+ import(/* webpackChunkName: "feed-mgr.module-require" */ "./feed-mgr/module-require").then(Lazy.onModuleImport($ocLazyLoad)).then(onModuleLoad);
+ }
});
+ $stateProvider.state({
+ name: 'user-details.**',
+ url: '/user-details/{userId}',
+ lazyLoad: (transition: any) => {
+ const $ocLazyLoad = transition.injector().get('$ocLazyLoad');
+ const onModuleLoad = () => {
+ return import(/* webpackChunkName: "admin.auth.module" */ "./auth/module")
+ .then(Lazy.onModuleFactoryImport($ocLazyLoad)).then(Lazy.goToState($stateProvider, "user-details", transition.params()));
+ };
+ import(/* webpackChunkName: "feed-mgr.module-require" */ "./feed-mgr/module-require").then(Lazy.onModuleImport($ocLazyLoad)).then(onModuleLoad);
}
});
