Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer 1.0 hidden$ attribute negate operator

Just trying to apply negate operator, it seems not working, any input on this appreciated.

it is definitely not a blocker, i can write a compute method to handle it, but negate operator makes more sense to me at-least.

Below snippet not working, if i remove the negate operator it works in opposite way of what i expect.

<div hidden$="{{!productDetails}}">
  My Hidden Content
</div>

Documentation (not a comprehensive one)

https://www.polymer-project.org/1.0/docs/devguide/templates.html

like image 812
Srini Avatar asked Jan 22 '26 17:01

Srini


1 Answers

You could use DOM if

<dom-module id="user-page">

  <template>

    All users will see this:
    <div>{{user.name}}</div>

    <template is="dom-if" if="{{user.isAdmin}}">
      Only admins will see this.
      <div>{{user.secretAdminStuff}}</div>
    </template>

  </template>

  <script>
    Polymer({
      is: 'user-page',
      properties: {
        user: Object
      }
    });
  </script>

</dom-module>
like image 128
MrK Avatar answered Jan 25 '26 21:01

MrK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!