Function
gte (dependentKey, value) ComputedProperty public
Module: | @ember/object |
---|
Defined in packages/@ember/object/lib/computed/computed_macros.js:594
import { gte } from '@ember/object/computed';
- dependentKey
- String
- value
- Number
- returns
- ComputedProperty
- computed property which returns true if the original value for property is greater or equal then given value.
A computed property that returns true if the provided dependent property is greater than or equal to the provided value.
Example:
import { set } from '@ember/object'; import { gte } from '@ember/object/computed'; class Hamster { @gte('numBananas', 10) hasTooManyBananas; } let hamster = new Hamster(); hamster.hasTooManyBananas; // false set(hamster, 'numBananas', 3); hamster.hasTooManyBananas; // false set(hamster, 'numBananas', 10); hamster.hasTooManyBananas; // true
Classic Class Example:
import EmberObject, { set } from '@ember/object'; import { gte } from '@ember/object/computed'; let Hamster = EmberObject.extend({ hasTooManyBananas: gte('numBananas', 10) }); let hamster = Hamster.create(); hamster.hasTooManyBananas; // false set(hamster, 'numBananas', 3); hamster.hasTooManyBananas; // false set(hamster, 'numBananas', 10); hamster.hasTooManyBananas; // true
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/3.25/functions/@ember%2Fobject%2Fcomputed/gte