bool (dependentKey) Ember.ComputedProperty
public
A computed property that converts the provided dependent property into a boolean value.
let Hamster = Ember.Object.extend({ hasBananas: Ember.computed.bool('numBananas') }); let hamster = Hamster.create(); hamster.get('hasBananas'); // false hamster.set('numBananas', 0); hamster.get('hasBananas'); // false hamster.set('numBananas', 1); hamster.get('hasBananas'); // true hamster.set('numBananas', null); hamster.get('hasBananas'); // false
Parameters:
-
dependentKey
String
Returns:
-
Ember.ComputedProperty
- computed property which converts to boolean the original value for property
Please login to continue.