What is the difference between the Reflect Attribute and Notify Polymer?

The polymer properties object supports two different keys, which I don’t quite understand the difference between reflectToAttribute and notify .

reflectToAttribute says that the attribute on the host node will change when the value changes.

notify says that it makes the property available for two-way binding.

Isn't that the same thing? If you have notify set to true , then is there any reason why you still need reflectToAttribute ?

Can someone explain to me how these keys are related to each other? Thanks!

+6
source share
1 answer

reflectToAttribute - get the attribute added to the DOM. So you can use it as a selector in CSS

notify is listed in your question for two-way binding.

These are two completely different goals.

+8
source

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


All Articles