daniel-nagy / md-data-table

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

adding a data table to an existing form #477

Open activedecay opened 8 years ago

activedecay commented 8 years ago

I would like for the simple case where I have a multi-select table to create ng FormController validators when using a data-table on a form. `

The above code creates a table on a form. The table has checkboxes for each row, but the controller'svm.myFormdoes not have the models created such that the form can be validated, i.e.,vm.myForm.checkboxRow1` should be an instance of NgModelController.

I guess I have to iterate over the dynamically created form elements (check boxes / radio buttons) and add them myself, but it would be awesome candidate for md-data-table library code. Unless, I'm just too lazy to write it myself (I have never seen dynamic form modification such as this, see / API Reference / ng / type components in ng / form.FormController.$addControl(control);