5
如何使用#view helper綁定類到視圖,如果布爾值爲FALSE?查看幫助:classBinding如果布爾值爲假
// this is working
{{#view App.MyView controllerBinding="this" classBinding="controller.content.isActive"}}
<div>test</div>
{{/view}}
// and this is what i want:
{{#view App.MyView controllerBinding="this" classBinding="!controller.content.isActive:is-not-active"}}
<div>test</div>
{{/view}}
我要綁定is-not-active
作爲一個類名認爲,如果controller.content.isActive
是假的。
我可以在視圖上做一個簡單的逆變器功能,但我有一個更好的方法。
謝謝。這正是我所說的「逆變器」的意思。我現在將使用它並希望收到請求。 – Lux 2012-07-11 11:57:32