Add a new row into mat-table using angular 4

前端 未结 1 812
半阙折子戏
半阙折子戏 2021-02-10 01:43

How to add a new row into Angular Material table manually from a input field.

Please see this image in that if i add a state name and state code it should present in the

相关标签:
1条回答
  • 2021-02-10 02:46

    I've put together a quick example that should give you a good hint as to where to start from: Working demo

    This works by using two-way data binding on the input field to keep track of what the user typed in the form. When the add button is then pressed, the table is updated with a new element dynamically created with the input content.

    0 讨论(0)
提交回复
热议问题