Angular2 why functions are called every time I move the mouse

I am using Angular2 seed ( https://github.com/mgechev/angular2-seed ) and I ran into a problem.

In fact, in my html template, I use some bindings like {{test}} with a variable test in the component and {{getTest ()}}, which calls the getTest () function.

If I use the console log in getTest (), every time I move the mouse I get a log.

Is this the desired behavior?

I thought it would only be updated if the value changes, as with the observer. Should I use an observer to avoid this call every time?

Thank.

+4
source share
1

Angular2 , , , , .

.

+4

Source: https://habr.com/ru/post/1649126/


All Articles