bool (dependentKey) Ember.ComputedProperty
public
A computed property that converts the provided dependent property into a boolean value.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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.