String#underscore()

underscore (str) Stringpublic

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

More general than decamelize. Returns the lower_case_and_underscored form of a string.

'innerHTML'.underscore();          // 'inner_html'
'action_name'.underscore();        // 'action_name'
'css-class-name'.underscore();     // 'css_class_name'
'my favorite items'.underscore();  // 'my_favorite_items'
'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice'

Parameters:

str String
The string to underscore.

Returns:

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

Please login to continue.