daniel-nagy / md-data-table

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

Error: [$compile:ctreq] Controller 'mdTable', required by directive 'mdCell', can't be found! #623

Open mattweason opened 7 years ago

mattweason commented 7 years ago

I'm having an issue when I try to use md-virtual-repeat-container with md-data-table. When the page loads it throws an error:

Error: [$compile:ctreq] Controller 'mdTable', required by directive 'mdCell', can't be found!

And the first row of the table only has 2 cells. The rest of the rows load fine. My html is below along with a photo.

<md-table-container md-virtual-repeat-container>
    <table md-table md-row-select ng-model="selected" md-progress="promise">
        <thead md-head md-order="query.order" md-on-reorder="getData" fix-head>
            <tr md-row>
                <th md-column md-order-by="{{key}}" ng-repeat="(key, col) in columns">{{col}}</th>
            </tr>
        </thead>
        <tbody md-body>
            <tr md-row md-select="p" md-select-id="name" md-auto-select md-virtual-repeat="p in tableContent">
                <td md-cell ng-repeat="(key, col) in columns">{{p[key]}}</td>
            </tr>
        </tbody>
    </table>
</md-table-container>

md-data-table-bug

This error occurs on several datatables in my platform but not all, and not consistently.

lehno commented 6 years ago

Same problem here, have you found a solution?

GaurangRLB commented 6 years ago

Is there any update regarding this issue? Same problem with V 0.10.9

Kerimr commented 5 years ago

Had the same error. Could fix it by removing a ng-if from table cell (and move it inside the cell). So - in my case - the error occured when there was a cell missing. Maybe that helps

<td md-cell">
         <md-icon ng-if="row.status === 'Error'">battery_alert</md-icon>
</td>