Function

gt (dependentKey, value) ComputedProperty public

Module: @ember/object
import { gt } from '@ember/object/computed';
dependentKey
String
value
Number
returns
ComputedProperty
computed property which returns true if the original value for property is greater than given value.

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

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/2.18/functions/@ember%2Fobject%2Fcomputed/gt