String#dasherize()

dasherize (str) Stringpublic

Defined in packages/ember-runtime/lib/system/string.js:245

Replaces underscores, spaces, or camelCase with dashes.

'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'

Parameters:

str String
The string to dasherize.

Returns:

String
the dasherized string.
doc_EmberJs
2016-11-30 16:53:29
Comments
Leave a Comment

Please login to continue.