I misled input with contentEditable. With contentEditable, you need to use a range to get the selection and set the selection.
To get a choice:
let range = document.createRange();
range = window.getSelection().getRangeAt(0);
this.rangeClone = range.cloneRange();
A combination of Selection and Range objects is used in Javascript. For more information, read the docs:
Selection
Range
To set a selection:
this.el.nativeElement.focus();
const sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(this.rangeClone);
This.el looks like this:
@ViewChild('contentEditable') public el: ElementRef;