The html element provides a promise that returns the instance of the DataTable.

The DataTable instance ID is: {{ (datatableElement?.dtInstance | async)?.table().node().id }}