Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

Reopen component class to give a default CSS class name based on component name

$
0
0

@sheriffderek wrote:

When I create a component such as {{my-useful-abstraction}} I would love to just have a default element class name of .my-useful-abstraction given to that component.

On a similar note, I reopened the LinkComponent class to add a .link class to all of them by default. How might I get the current component name and use that to give each component a class of its dasherized name?

Ember.LinkComponent.reopen({
  classNames: ['link'],
});

Side question: Where would you expect additions of this nature to live in the project structure?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles