acid_srvnn
acid_srvnn

Reputation: 693

Inverse of property in Ember Template

I have Boolean property enableInput that says whether the input is to be disabled or not. The disabled property of input need to be inverse of enableInput. How to do this without using another property?

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

Upvotes: 0

Views: 922

Answers (1)

Daniel
Daniel

Reputation: 18672

Use inline-if helper:

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

Upvotes: 3

Related Questions