Function

dependentKey
String
value
Number
returns
ComputedProperty
computed property which returns true if the original value for property is less then given value.

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

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { lt } from '@ember/object/computed';
import EmberObject from '@ember/object';

let Hamster = EmberObject.extend({
  needsMoreBananas: lt('numBananas', 3)
});

let hamster = Hamster.create();

hamster.get('needsMoreBananas'); // true
hamster.set('numBananas', 3);
hamster.get('needsMoreBananas'); // false
hamster.set('numBananas', 2);
hamster.get('needsMoreBananas'); // true