Last active
August 29, 2015 14:14
-
-
Save mshustov/82ef15b95bcdccce34aa to your computer and use it in GitHub Desktop.
handlebars like template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reg = /\{\{(.+?)\}\}/gim; | |
var zz = 'hello {{name}} {{surname}}'.replace(reg, function(full, key){ | |
switch(key){ | |
case 'name': | |
return 'myName'; | |
case 'surname': | |
return 'mySurname' | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment