Ember.computed.not()

not (dependentKey) Ember.ComputedPropertypublic

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

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
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

Parameters:

dependentKey String

Returns:

Ember.ComputedProperty
computed property which returns inverse of the original value for property
doc_EmberJs
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.