In a directive.ts file, I would like to modify a DOM element. When I do a browser debug, and stop in the directive, I can inspect its elements, but I do not know how to access the elements in typescript as I see them in the debugger.
Here's the relevant ts code:
drawSparklines() {
console.log("drawSparklines");
$('.sparkline:not(:has(>canvas))', this.container).each((i, el) => {
const $el = $(el);
const sparklineType = $el.data('sparkline-type') || 'bar';
if($el.nativeElement.innerText === "dataIncome") {
$el.nativeElement.innerText.val = this.dataIncome;
}
I added the conditional, above, where I am trying to inspect the innerText value, and change it if it equals dataIncome to a class property.
In the attached screen shot taken in the debugger, you can see the innerText property. But, how to actually work with it in ts?
Debugger Screen Shot:
Thanks for helping! Bob