简体   繁体   English

Ember模板中的属性逆

[英]Inverse of property in Ember Template

I have Boolean property enableInput that says whether the input is to be disabled or not. 我有布尔属性enableInput ,它表示是否要禁用输入。 The disabled property of input need to be inverse of enableInput . inputdisabled属性必须与enableInput相反。 How to do this without using another property ? 如何在不使用其他属性的情况下执行此操作

{{input type='text' value=model.someValue disabled=invert(model.enableInput)}}

Use inline-if helper: 使用inline-if助手:

{{input type='text' value=model.someValue disabled=(if enableInput false true)}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM