Ember.computed.lte()

lte (dependentKey, value) Ember.ComputedPropertypublic

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

A computed property that returns true if the provided dependent property is less than or equal to the provided value.

Example

1
2
3
4
5
6
7
8
9
10
11
let Hamster = Ember.Object.extend({
  needsMoreBananas: Ember.computed.lte('numBananas', 3)
});
 
let hamster = Hamster.create();
 
hamster.get('needsMoreBananas'); // true
hamster.set('numBananas', 5);
hamster.get('needsMoreBananas'); // false
hamster.set('numBananas', 3);
hamster.get('needsMoreBananas'); // true

Parameters:

dependentKey String
value Number

Returns:

Ember.ComputedProperty
computed property which returns true if the original value for property is less or equal than given value.
doc_EmberJs
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.