-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.js
More file actions
14 lines (14 loc) · 711 Bytes
/
Copy pathmodule.js
File metadata and controls
14 lines (14 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module.exports= function replaceHtml(template,product){
let output=template.replace(/{{%IMAGE%}}/g,product.productImage)
output=output.replace(/{{%NAME%}}/g,product.name)
output=output.replace(/{{%MODELNAME%}}/g,product.modeName)
output=output.replace(/{{%MODELNO%}}/g,product.modelNumber)
output=output.replace(/{{%SIZE}}/g,product.size)
output=output.replace(/{{%CAMERA%}}/g,product.camera)
output=output.replace(/{{%PRICE%}}/g,product.price)
output=output.replace(/{{%COLOR%}}/g,product.color)
output=output.replace(/{{%ROM%}}/g,product.ROM)
output=output.replace(/{{%ID%}}/g,product.id)
output=output.replace(/{{%DESC%}}/g,product.Description)
return output
}