String#fmt()

fmt (str, formats) Stringdeprecatedpublic

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

Use ES6 template strings instead: http://babeljs.io/docs/learn-es2015/#template-strings

Apply formatting options to the string. This will look for occurrences of "%@" in your string and substitute them with the arguments you pass into this method. If you want to control the specific order of replacement, you can add a number after the key as well to indicate which argument you want to insert.

Ordered insertions are most useful when building loc strings where values you need to insert may appear in different orders.

"Hello %@ %@".fmt('John', 'Doe');     // "Hello John Doe"
"Hello %@2, %@1".fmt('John', 'Doe');  // "Hello Doe, John"

Parameters:

str String
The string to format
formats Array
An array of parameters to interpolate into string.

Returns:

String
formatted string
doc_EmberJs
2016-11-30 16:53:29
Comments
Leave a Comment

Please login to continue.