Skip to content

Instantly share code, notes, and snippets.

@var-bin
Last active December 22, 2017 18:19
Show Gist options
  • Save var-bin/b7a7026a683bca634132dc1aa61da839 to your computer and use it in GitHub Desktop.
Save var-bin/b7a7026a683bca634132dc1aa61da839 to your computer and use it in GitHub Desktop.
const appBlog = {
name: "blog",
url: "/blog",
component: "blogComponent",
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get("$ocLazyLoad");
// !!! Dynamic import !!!
return import(/* webpackChunkName: "blog.module" */ "./pages/blog/blog.module")
.then(mod => $ocLazyLoad.load(mod.BLOG_MODULE))
.catch(err => {
throw new Error("Ooops, something went wrong, " + err);
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment