quramy / angular2-load-children-loader Goto Github PK
View Code? Open in Web Editor NEWA webpack loader for ng2 lazy loading
License: MIT License
A webpack loader for ng2 lazy loading
License: MIT License
This is working great for me with Angular2 final and Webpack 2.1.0-beta.22. Thank you!
I'd love the option to name the resulting bundles by the module name instead of 0, 1, 2 ... etc
Please a question, will I have to install this webpack every time I start the server in production? Because every day that I start work on the project the hotas do not work in production mode so I have to install this web pack, if that would have a permanent form? Thanks for the help
CSS and Images pass to the children are not working with lazy routing but if it use with the regular routing its work
There is not showing any error on console please tell me any method to get access css and images.
Thank You
I'm getting an error when using this loader:
dll.vendors.bundle.js.gz?8609335โฆ:38082 EXCEPTION: Uncaught (in promise): TypeError: __webpack_require__(...) is not a function
The loader seems to transpile it correctly. My routes
{
path: 'detail',
loadChildren: '../+detail/detail.module#DetailModule',
canActivate: [RouteProtection]
}, {
path: 'monsoon',
loadChildren: '../+monsoon-reports/monsoon.module#MonsoonModule',
canActivate: [RouteProtection]
},
Here is the AOT compiled app.bundle.js
Object.defineProperty(AppModuleInjector.prototype, "_ROUTES_47", {
get: function () {
if ((this.__ROUTES_47 == null)) {
(this.__ROUTES_47 = [[
{
path: '',
component: import51.LoginComponent
},
{
path: 'detail',
loadChildren: function () { return __webpack_require__(118)("DetailModuleNgFactory"); }
},
{
path: 'monsoon',
loadChildren: function () { return __webpack_require__(119)("MonsoonModuleNgFactory"); },
canActivate: [import35.RouteProtection]
},
{
path: 'ticket',
component: import52.TicketComponent,
canActivate: [import35.RouteProtection]
},
{
path: 'grid1',
component: import53.HomeComponent,
canActivate: [import35.RouteProtection]
},
{
path: 'grid2',
component: import54.SubscriberComponent,
canActivate: [import35.RouteProtection]
},
{
path: 'login',
component: import51.LoginComponent
},
{
path: 'about',
component: import55.AboutComponent,
canActivate: [import35.RouteProtection]
},
{
path: '**',
component: import56.NotFound404Component
},
{
path: '404',
component: import56.NotFound404Component
}
]
]);
}
return this.__ROUTES_47;
},
enumerable: true,
configurable: true
});
__webpack_require__
does exist during other parts of the app loading, but for some reason at this point in the app, its not a function.
However, if I use es6 promise loader:
loadChildren: 'es6-promise?,[name]!../+detail/detail.module#DetailModule'
It works fine in both AOT mode and JIT mode.
Any ideas what I'm doing wrong which causes it not to work in non-lazy load (without es6-promise)?
Hi I'm trying to use your loader but I receive in the console this kind of error:
VM6476:48 EXCEPTION: Uncaught (in promise): TypeError: __webpack_require__(...) is not a function
my webpack.config is:
rules: [
// Support for .ts files.
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader?'inlineSourceMap=true&sourceMap=false', 'angular2-load-children-loader', 'angular2-template-loader', '@angularclass/hmr-loader'],
exclude: [isTest ? /\.(e2e)\.ts$/ : /\.(spec|e2e)\.ts$/, /node_modules\/(?!(ng2-.+))/]
},
and I use in that way:
imports: [
BrowserModule,
HttpModule,
FormsModule,
RouterModule.forRoot([
{path: '', loadChildren: './home/home.module#HomeModule'},
{path: 'about', loadChildren: './about/about.module#AboutModule'}
])],
Wbpack-version: "webpack": "^2.1.0-beta.25",
what I did wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.