daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 520 forks source link

Table not create checkboxes when i redirect to $state of table #625

Open dmartinsti opened 6 years ago

dmartinsti commented 6 years ago

Table not create checkboxes when i redirect to $state of table

Now, if I refresh the page manually the checks are created normally.

See pictures

Before captura de tela 2017-10-05 as 13 51 37

After reload manually captura de tela 2017-10-05 as 13 52 09

Help-me

mr-bre commented 6 years ago

I have the same issue. But the problem is not (only) the routing/state. In my case it is that md-select exists twice one in ngMaterial und one in md.data.table. When the ngMaterial's md-select is loaded before routing to a state that contains md.data.table's md-select then this select directive will not load. Both directives will be loaded when they are on the same state. You can reproduce when you start at a state with no md-select and navigate to a state with a table md-select (and optional option md-select) this will be rendered with checkboxes. When you start at a state with only a option md-select and navigate to a state with a table md-select the checkboxes will not show.

My workaround for this issue is adding md.data.table as a requirement for material.core or material.components.select (second not tried yet but should work). This will then load both md-select directives if one of them is needed. This is a little overhead because it extends angular material and increases the potential load time when md-data-table isn't needed.

angular.module('material.core').requires.push('md.data.table');