Getting your Angular 2 library ready for AoT
Isaac Mann
627

Hi, Isaac thanks for Posts

But I want to register a Lazy loading like this:

const tenantRoutes: Routes = [
{
path: ‘t’, loadChildren: () => new Promise(resolve => {
(require as any).ensure([], function (require: any) {
resolve(require(‘./tenant/CKW/module’)[‘CKWModule’]);
})})
}]

and call this

export const routing: ModuleWithProviders = RouterModule.forRoot(tenantRoutes);

when I build it have issue

ERROR in Error encountered resolving symbol values statically. Reference to a local (non-exported) symbol ‘tenantRoutes’. Consider exporting the symbol (position 16:7 in the original .ts file), resolving symbol routing

I try with AoT but it not working, so how I can fix it?

Show your support

Clapping shows how much you appreciated Đào Hải’s story.