39. Modern JavaScript and Vanilla JavaScript Integration

The Problem

Business developers often still need direct access to native HTML elements, browser APIs, and existing JavaScript libraries.

The Angular Difficulty

Angular permits direct DOM access through `ElementRef`, but the framework generally prefers bindings and its rendering abstractions; direct access needs lifecycle care.

Angular Approach

@ViewChild("txt") txt!: ElementRef<HTMLInputElement>;

setValue() {
    this.txt.nativeElement.value = "Apple";
}

// template
<input #txt />

MS Approach

ManySet provides a direct runtime-oriented approach for this recurring business-application task.

ms.id("txtBox1").value = "Apple";
ms.id("board1").addEventListener("click", f);

ms.el.button("b2").onclick = () =>
    ms.inject("./b", "a");

ms.id("video").play();
ms.id("div").getBoundingClientRect();

Why this way is useful in business applications :

The comparison is intended to show where ManySet supplies a business-application abstraction around a recurring task, while keeping HTML and JavaScript visible and directly usable.

Key Point :

ManySet reduces the amount of framework-specific composition required for this particular task, without requiring the React/Angular mechanism to be represented as inherently wrong or incapable.