05. Component Communication

The Problem

Separate business components often need a controlled way to exchange commands or data without tightly coupling their UI trees.

The Angular Difficulty

Angular commonly uses `@Input()` and `@Output()` for component communication. For distant components, services, RxJS, or shared state are commonly introduced.

Angular Approach

@Output() saved = new EventEmitter<number>();

save() {
    // ...
    this.saved.emit(1001);
}

// parent template
<app-customer (saved)="onSaved($event)" />

MS Approach

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

const customer = await ms.inject("./Customer", "content");
customer.onSaved = id => console.log(id);

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.