Ember.computed.gt()

gt (dependentKey, value) Ember.ComputedPropertypublic

Defined in packages/ember-runtime/lib/computed/computed_macros.js:287

A computed property that returns true if the provided dependent property is greater than the provided value.

Example

let Hamster = Ember.Object.extend({
  hasTooManyBananas: Ember.computed.gt('numBananas', 10)
});

let hamster = Hamster.create();

hamster.get('hasTooManyBananas'); // false
hamster.set('numBananas', 3);
hamster.get('hasTooManyBananas'); // false
hamster.set('numBananas', 11);
hamster.get('hasTooManyBananas'); // true

Parameters:

dependentKey String
value Number

Returns:

Ember.ComputedProperty
computed property which returns true if the original value for property is greater than given value.
doc_EmberJs
2016-11-30 16:51:14
Comments
Leave a Comment

Please login to continue.