Function

not (dependentKey) ComputedProperty public

Module: @ember/object
import { not } from '@ember/object/computed';
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

let User = Ember.Object.extend({
  isAnonymous: Ember.computed.not('loggedIn')
});

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

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

© 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/not