Ember.computed.empty()

empty (dependentKey) Ember.ComputedPropertypublic

Defined in packages/ember-runtime/lib/computed/computed_macros.js:53
Available since 1.6.0

A computed property that returns true if the value of the dependent property is null, an empty string, empty array, or empty function.

Example

let ToDoList = Ember.Object.extend({
  isDone: Ember.computed.empty('todos')
});

let todoList = ToDoList.create({
  todos: ['Unit Test', 'Documentation', 'Release']
});

todoList.get('isDone'); // false
todoList.get('todos').clear();
todoList.get('isDone'); // true

Parameters:

dependentKey String

Returns:

Ember.ComputedProperty
computed property which negate the original value for property
doc_EmberJs
2016-11-30 16:51:13
Comments
Leave a Comment

Please login to continue.