Polymer 1 nested dom-if inside dom-repeat, not updated when data changes

How do you make dom-ifpatterns dom-repeatwhen changing data?

An example is here http://jsbin.com/xatala/edit?html,output

In the example, the data changes after 1.5 seconds, but the dom-if inside the template is not reevaluated / displayed. You can see this in console.log. The data has changed, but the view has not been updated.

How would you do this job and what are the arguments for it ?!

+4
source share
1 answer

Here is an example that works: http://jsbin.com/nejadibuju/edit?html,console,output

<template is="dom-if" 
  if="{{arrayItem(myItems.*, index, 'isGood')}}">
      [[item.title]] is SOOO good.
</template>

What you are missing:

Explicit bindings to array elements by index are not supported

Bin. :

, ,

http://plnkr.co/edit/aOmw4e?p=preview

+3

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


All Articles