With [Polymer 0.5](https://www.polymer-project.org/0.5/docs/polymer/expressions.html) the [`<template>`](https://www.polymer-project.org/0.5/docs/polymer/template.html) element had a lot of functionality, allowing awesome expressions like `<template if="{{items.length > 0}}">` to easily display some message if an array was empty.

Now in [Polymer 1.0 this has unfortunately changed](https://www.polymer-project.org/1.0/docs/devguide/templates.html#dom-if), and I'm wondering what the best way is to get this done.

I have come up with two scenarios, but I'm not sure which is the best for performance.

The first option would be to have an extra variable that is `readOnly` and is `computed` whenever the array is changed:

```
<template is="dom-if" if="{{itemsEmpty}}">
    The array is empty!
</template>

<script>
    Polymer({
      is: 'my-element',
      properties: {
        items: {
          type: Array
        },
        itemsEmpty: {
          type: Boolean,
          computed: 'computeItemsEmpty(items)',
          readOnly: true
        }
      },
      ready: function() {
        this.items = [{'name': 'Jack'}, {'name': 'Skellington'}];
      },
      computeItemsEmpty: function(items){
        return items.length == 0;
      }
    });
</script>

```

The second option would be to make `itemsChanged` set by the observer of `items`:

```
<template is="dom-if" if="{{itemsEmpty}}">
    The array is empty!
</template>

<script>
    Polymer({
      is: 'my-element',
      properties: {
        items: {
          type: Array,
          observer: '_itemsChanged'
        },
        itemsEmpty: {
          type: Boolean
        }
      },
      ready: function() {
        this.items = [{'name': 'Jack'}, {'name': 'Skellington'}];
      },
      _itemsChanged: function(newValue, oldValue){
        this.itemsEmpty = newValue.length == 0;
      }
    });
</script>

```

So which of these is the best practice, or is there even another way to do this? I also tried by using a function inside the `if`, but of course this wasn't re-evaluated.