I use Angular2 seed (https://github.com/mgechev/angular2-seed), and I encounter a problem.
Indeed, in my template html, I use some bindings like {{test}} with a variable test in the component, and {{getTest()}} which calls the getTest() function.
If I use a console log in getTest(), each time I move the mouse, I get a log.
Is it the desired behaviour ?
I was thinking it will update only if the value changes, like with an observer. Did I have to use an observer to avoid this call each time ?
Thanks you.
Angular2 change detection checks if bindings are updated every time it is run and it is usually run when events that are listened to are fired.
This is why it is discouraged to use method calls in bindings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With