04. Accessing Component Properties

The Problem

A parent may need to read a value exposed by a business component, such as a selected customer or entered age.

The Angular Difficulty

Angular normally uses bindings and component state. Imperative access to a DOM value uses `@ViewChild`/`ElementRef` and must respect Angular view timing.

Angular Approach

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

readAge() {
    return this.ageBox.nativeElement.value;
}

// template
<input #ageBox />

MS Approach

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

const person = await ms.inject("./Person", "content");
const age = person.txtAge;

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.