Closed dynamics12 closed 7 years ago
Hi! Totally right, I'm sorry I still haven't approached lazy loading of routes. Any idea on how to solve it?
Is very good guestion. i Rly need this too
Hey guys, very sorry I still couldn't find time to dig into this problem (had anybody a look at this?).
Just a suggestion in the meantime, lazy loaders, could you try applying to you Angular-CLI app the config change that @clydin suggests in this issue?
https://github.com/angular/angular-cli/issues/6505
(let me know if it works...)
You might want to import MdDataTableModule on your LazyLoduled module.
Could anyone provide a documentation of the table? I want to add some icons next to checkboxes. Any help?
This probably deserves another issue/feature request. Right now you can't override the checkboxes part, there's just a selectable attribute on the datatable to show/hide them.
@leocaseiro did the MdDataTableModule worked for you from a LazyModule? Never had chance to try that so far...
Same bug for me
Okay at last I had time to play with lazy routes. There's no bug related to lazy loading.
I've been playing with 2 lazy routes, alongside with non-lazy routes. All my MdDatatable components are in the lazy routes. Some of them are preloaded, some not.
To give you an insight of my code:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
...
import { MdDataTableModule } from 'ng2-md-datatable';
@NgModule({
imports: [
// don't forget that
CommonModule,
// Material 2 modules, pick the ones you use
// ng2-md-datatable
MdDataTableModule,
RouterModule.forChild(Routes),
],
declarations: [...],
exports: [RouterModule],
})
export class BlablaLazyRoutingModule { }
From the main Routes config:
{
path: '',
loadChildren: 'app/routing/blabla.routing.module#BlablaLazyRoutingModule',
},
I'll close this one until one prove there's a bug with ng2-md-datatable.
My current setup:
I have included the MdDataTableModule in the AppModule but the components are not available when used in a lazy-loaded module. I used to import this module in SharedModule but latest release doesn't allow me to do that anymore.
Error: Template parse errors: 'ng2-md-datatable-column' is not a known element: