I've come across a very peculiar issue in my Angular application.
Imagine I have a simple example.component.ts
@Component({
moduleId: module.id.toString(),
selector: 'example',
templateUrl: 'example.component.html',
styles: [``]
})
export class ExampleComponent{
get buttonShouldBeDisabled(){
console.log("property call");
return true;
}
}
and the template looks like this
<html>
<body>
<button type="button" [disabled]="buttonShouldBeDisabled">Button</button>
</body>
</html>
In the browser console, I notice that "property call" is being logged repeatedly. https://i.sstatic.net/GlA8u.png
What could be causing this behavior? Am I correct in assuming that this means the property is being called in a loop, potentially causing the browser to become unresponsive to user actions?