An accessor method, commonly written as a getter, computes and returns a value when code or a template reads it like a property. In an Angular component, a getter can expose derived data without requiring parentheses in the template. section 9.6.2 section 10.2
Deriving values for a template
A component can calculate product information from its model and expose the results through getters: get count(): number { return this.model.getProducts().length; } get total(): string { return this.model.getProducts() .reduce((total, p) => total + (p.price ?? 0), 0) .toFixed(2); } get message(): string { return `${this.messages[this.index]} $${this.total}`; } The template reads these values with {{ count }} and {{ message }}. Angular evaluates the bindings, reads the component values, and creates the displayed DOM content. section 10.2
Getters are convenient for derived display values, but their bodies may run whenever Angular checks the template. A costly getter therefore repeats its work even when unrelated changes occur, causing pauses and making binding performance harder to manage. section 10.3.2
Signals provide an alternative when derived values should update selectively. A getter can expose a read-only signal, while a computed signal replaces a frequently reevaluated getter and is read with function-call syntax such as {{ count() }}. section 10.4.4












