我试图打印变量值而不用绑定语法{{}}绑定它,因为在我的情况下我有一个可编辑的输入和第二个输入的默认值,每次我也使用语法编辑输入defaut值输入更改:
var operation = POST.operation; // POST request comes with operation = update/insert/delete
if (operation == 'insert') {
fs.readFile("data.json", "utf8", function (err) {
var updateData = {
id: POST.id,
name: POST.name,
}
var newUser = JSON.stringify(updateData);
fs.writeFile("data.json", newUsers, "utf8");
console.log(err);
})
}
else if (operation == 'update') {
fs.readFile("data.json", "utf8", function (err) {
})
}
else if (operation == 'delete') {
fs.readFile("data.json", "utf8", function (err) {
})
}
else
console.log("Operation is not supported");
所以我需要在默认值输入的情况下只打印值而不绑定它