mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(util) render
This commit is contained in:
parent
3410a98f93
commit
2653a2293e
1 changed files with 4 additions and 4 deletions
|
|
@ -257,14 +257,14 @@
|
|||
* @param view
|
||||
*/
|
||||
this.render = function(templ, view) {
|
||||
var str, regExp,
|
||||
result = templ;
|
||||
var result = templ;
|
||||
|
||||
Object
|
||||
.keys(view)
|
||||
.forEach(function(param) {
|
||||
str = view[param];
|
||||
regExp = RegExp('{{\\s' + param + '\\s}}', 'g');
|
||||
var str = view[param],
|
||||
regExp = RegExp('{{\\s' + param + '\\s}}', 'g');
|
||||
|
||||
result = result.replace(regExp, str);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue