0
我想屬性ID添加到動態標籤,但它給錯誤淘汰賽組件綁定屬性錯誤
"Uncaught ReferenceError: Unable to process binding "attr: function(){return {id:id} }" Message: id is not defined"
我的HTML的
<label data-bind="text:label"></label>
<span class="name" data-bind="attr:{id:id},html:value"></span>
<span class="cancelled" data-bind="html:cancel"></span>
<span class="currency-block" data-bind="html:amount"></span>
我的觀點基於模型
this.listrows = [
{layout:'basic', params:{icon:'icon-phone', items:[
{item:'content', type:'basic', params:{id:'test', label:'From Account',value:'asuhdas'}}
]}},
{layout:'basic', params:{icon:'icon-money', items:[
{item:'content', type:'basic', params:{label: 'To Account:', value:''}}
]}}
]
我添加了attr:{id:id}仍然存在錯誤。任何人都可以幫助我。
我也認爲這是問題,完全限定你的綁定總是很好的做法。 – abc123 2014-09-19 10:16:07
@詹姆斯還沒有同樣的錯誤 – user3747168 2014-09-19 10:18:02
@ user3747168你可以請張貼更多的HTML嗎? – 2014-09-19 10:18:28