#86 dasherize

Most of you probably already know this but here it is anyway. Ember has a built-in dasherize function that replaces underscores, spaces, or camelCase with dashes.

Here are examples straight from the ember docs:

'innerHTML'.dasherize();          // 'inner-html'
'action_name'.dasherize(); // 'action-name'
'css-class-name'.dasherize(); // 'css-class-name'
'my favorite items'.dasherize(); // 'my-favorite-items'
'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice

Originally published at Ember Daily Tips.

Like what you read? Give Emad Ibrahim a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.