An event binding calls a class method when someone uses a control. Read the current state inside the handler. Reusing the initial count can pass the first click and fail the next. Input events carry the current field value in their target.
Read the supplied records before you change the component. The preview runs your code, so use the controls and inspect the result after more than one action. Some records have a zero value or share a name. Those are deliberate cases, and the hidden records change the values again. Keep the calculation tied to its inputs rather than typing the first expected result into the template. The check accepts a different implementation when it preserves the same visible behavior.
Keep the example's element IDs, classes and control labels so checks can locate the output; your Angular implementation can differ.
Trace the component members into the template, then try the relevant control in the preview.