@Component({
template: `Hello {{user.getName()}}``
})
class UserProfile {
user: User = new User();
}
Let's say that user has all fields private and the only way to access them is by calling methods. We all know that Angular calls change detection rather often but I'm curious whether such simple method like:
getName(): string {
return this.name;
}
costs something? If change detection triggers a lot of times then all those methods calls are being added to the stack. What's your opinion?