daviddt / angular2-lazy-load-example Goto Github PK
View Code? Open in Web Editor NEWAngular 2 lazy load example
Angular 2 lazy load example
^[[1m^[[31mERROR in ./src/polyfills.ts
Module build failed: TypeError: Cannot read property 'exclude' of undefined
at applyDefaults (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/instance.ts:266:72)
at Object.ensureInstance (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/instance.ts:145:5)
at compiler (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/index.ts:37:20)
at Object.loader (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/index.ts:18:18)
@ multi polyfills^[[39m^[[22m
^[[1m^[[31mERROR in ./src/vendor.ts
Module build failed: TypeError: Cannot read property 'exclude' of undefined
at applyDefaults (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/instance.ts:266:72)
at Object.ensureInstance (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/instance.ts:145:5)
at compiler (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/index.ts:37:20)
at Object.loader (/Users/xxxx/OVSLazyLoad/node_modules/awesome-typescript-loader/src/index.ts:18:18)
@ multi vendor^[[39m^[[22m
"startuplog.txt" 38L, 2535C
Hello, congratulations for the example!!
I've tried to replace angular version to 4 and run it, but it doesn't work (I have to ckeck it deeply..)
Are you planning to you upgrade yout example to Angular 4??
Hi i need to use module within lazy module and load component into that so i modified sample from this repository bu i am getting the issue
core.umd.js?e2a5:3462 EXCEPTION: Uncaught (in promise): Error: Cannot match any routes: 'sync' Error: Cannot match any routes: 'sync'
sync.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AboutComponent } from './about.component';
const routes: Routes = [
{ path: 'sync', component: AboutComponent },
];@NgModule({
imports: [
RouterModule.forChild(routes)
],
exports: [],
declarations: [AboutComponent],
providers: [],
})
export class SyncModule { }
about.module.ts
import { NgModule } from '@angular/core';
import { AboutRoutingModule } from './about.routing';
import { AboutComponent } from './about.component';
@NgModule({
imports: [
AboutRoutingModule
],
exports: [],
declarations: [AboutComponent],
providers: [],
})
export class AboutModule { }
about.routing.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AboutComponent } from './about.component';
const routes: Routes = [
{ path: 'sync', loadChildren: './sync.module#SyncModule' },
{ path: '', redirectTo: '/sync', pathMatch: 'full' }
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class AboutRoutingModule { }
app.component.html
< a routerLink="/home" routerLinkActive="active">Home < a routerLink="/about" routerLinkActive="active">About (lazy) < a routerLink="/sync" routerLinkActive="active">SyncA 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.