W3cubDocs

/Ember.js

Ember.ClassNamesSupport Class

PRIVATE

Defined in: packages/ember-views/lib/mixins/class_names_support.js:13

Module: ember-views

childViewsArrayprivate

Defined in packages/ember-views/lib/mixins/child_views_support.js:22

Array of child views. You should never edit this array directly.

Default: []

classNameBindingsArraypublic

Defined in packages/ember-views/lib/mixins/class_names_support.js:40

A list of properties of the view to apply as class names. If the property is a string value, the value of that string will be applied as a class name.

// Applies the 'high' class to the view element
Ember.Component.extend({
  classNameBindings: ['priority'],
  priority: 'high'
});

If the value of the property is a Boolean, the name of that property is added as a dasherized class name.

// Applies the 'is-urgent' class to the view element
Ember.Component.extend({
  classNameBindings: ['isUrgent'],
  isUrgent: true
});

If you would prefer to use a custom value instead of the dasherized property name, you can pass a binding like this:

// Applies the 'urgent' class to the view element
Ember.Component.extend({
  classNameBindings: ['isUrgent:urgent'],
  isUrgent: true
});

This list of properties is inherited from the component's superclasses as well.

Default: []

classNamesArraypublic

Defined in packages/ember-views/lib/mixins/class_names_support.js:28

Standard CSS class names to apply to the view's outer element. This property automatically inherits any class names defined by the view's superclasses as well.

Default: ['ember-view']

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
http://emberjs.com/api/classes/Ember.ClassNamesSupport.html