Function

dependentKey
String
returns
ComputedProperty
computed property which returns inverse of the original value for property

A computed property that returns the inverse boolean value of the original value for the dependent property.

Example

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

let User = EmberObject.extend({
  isAnonymous: not('loggedIn')
});

let user = User.create({loggedIn: false});

user.get('isAnonymous'); // true
user.set('loggedIn', true);
user.get('isAnonymous'); // false