polymer - How to use the "hidden" attribute? -
i can see official polymer elements using hidden
attribute so:
hidden$="[[!somevalue]]"
, hidden$=[[somevalue]]
however, in case, somevalue
huge object , while above expressions still work, hidden$=[[somevalue]]
can see this:
app unnecessary work serializing object + having text makes harder me work devtools.
so, used hidden=[[somevalue]]
, hidden=[[!somevalue]]
instead. these work charm.
my questions are:
- can safely use
hidden=
instead ofhidden$=
? - why works? understood
$=
sets attributes ,=
sets properties. - if should use
hidden$=
whats best wayhidden$=[[bigobject]]
?
it looks can safely use hidden
attribute or property. this polyfill webcomponentsjs library says setting property reflect attribute. explain why $=
, =
have same behavior.
since setter overrides value ''
, expect setting property (=
) use less memory , more performant, benchmarks real way know sure.
Comments
Post a Comment