var toString = require('../lang/toString');
var get = require('../object/get');
var stache = /\{\{([^\}]+)\}\}/g; //mustache-like
/**
* String interpolation
*/
function interpolate(template, replacements, syntax){
template = toString(template);
var replaceFn = function(match, prop){
return toString( get(replacements, prop) );
};
return template.replace(syntax || stache, replaceFn);
}
module.exports = interpolate;
# |
Change |
User |
Description |
Committed |
|
#1
|
23539 |
jenbottom |
Adding the basic code for ember test appk, created with 'ember new' command |
|
|