For example: Ember components allow you to add an array of classNames, and these classes will be added to the main component div. let's say we have this component called new-div
export default Ember.Component.extend({ classNames: ['container'] });
then if you check this component during visualization, you will see:
<div id="ember595" class="ember-view container"> ... <div>
This is normal, but my problem is that if I want to use this component as a container for liquid, sometimes, and sometimes I may want to make it jumbotron, etc.
Is there a way to do this in html and is it right to apply the .js component?
{{new-div extra-classes='class1,class2'}}
then in component.js:
export default Ember.Component.extend({ classNames: [this.get('class-names')] });
pfg
source share