Want to set cursor focus at end of the text for every <td>
<table #sampleTable>
<th>name</th>
<th>number</th>
<tr>
<td #name contenteditable="true">
jack
</td>
<td #number contenteditable="true">
5487
</td>
</tr>
</table>
component.ts
@ViewChild('name') colName;
...
ngAfterViewInit(){
setTimeout(() => {
this.colName.nativeElement.focus() //setting focus at name column
}, 1000);
}
but unable to set cursor at end of the text. Any one help me out in a angular way with out using Jquery.