我想知道是否有可能使用聚合物表達式來綁定一個屬性有條件的一個元素,同時也分配給它一個值,如果綁定爲true?聚合物綁定條件屬性和評估屬性
我知道如何做到既seperately:
pattern?="{{someBoolean}}"
pattern="{{someBoolean ? 'value if true' : 'value if false'}}"
,但在完成這兩個不使用的元素的原型定義額外的JavaScript已經失敗。
任何幫助或建議表示讚賞!
編輯:
在上面的例子中
if (someBoolean)
<input pattern="value if true"/>
else if (!someBoolean)
//pattern attribute is not bound and attribute assignment does not occur
<input/>
呃,我希望它可以。如果他們結合了這兩種行爲,那將會很好。 – andrsnn 2015-04-02 02:05:09