or (dependentKey) Ember.ComputedProperty
public
A computed property which performs a logical or
on the original values for the provided dependent properties.
You may pass in more than two properties and even use property brace expansion. The computed property will return the first truthy value or last falsy value just like JavaScript's ||
operator.
Example
let Hamster = Ember.Object.extend({ readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') }); let tomster = Hamster.create(); tomster.get('readyForRain'); // undefined tomster.set('hasUmbrella', true); tomster.get('readyForRain'); // true tomster.set('hasJacket', 'Yes'); tomster.get('readyForRain'); // 'Yes' tomster.set('hasSunscreen', 'Check'); tomster.get('readyForBeach'); // 'Check'
Parameters:
-
dependentKey
String
Returns:
-
Ember.ComputedProperty
- computed property which performs a logical `or` on the values of all the original values for properties.
Please login to continue.