-4
我需要刪除雙引號特定鍵值報價:JavaScript對象刪除特定鍵值
upload: {
name: "upload",
url: "/upload",
controller: "invoicesCtrl",
templateUrl: "./views/invoices.html",
resolve: "resolveUrl('./compiled/invoices_app.js')"
},
invoices: {
name: "invoices",
url: "/invoices",
controller: "invoicesCtrl",
templateUrl: "/invoices/views/invoices.html",
resolve: "resolveUrl('/invoices/app/js/compiled/invoices_app.js')"
}
只是爲了解決鍵值,其他必須是字符串。有沒有這個replace
函數的任何正則表達式?預期的結果:
upload: {
name: "upload",
url: "/upload",
controller: "invoicesCtrl",
templateUrl: "./views/invoices.html",
resolve: resolveUrl('./compiled/invoices_app.js')
},
invoices: {
name: "invoices",
url: "/invoices",
controller: "invoicesCtrl",
templateUrl: "/invoices/views/invoices.html",
resolve: resolveUrl('/invoices/app/js/compiled/invoices_app.js')
}
假設你正在使用JavaScript,可能重複:http://stackoverflow.com/questions/19156148/i-want-to-remove-double-quotes-from-a -串。 –
@SeanPerkins那不是我所期望的 – AndreFontaine
如果我正確理解你的問題,你想爲'resolve'的當前值運行'eval'的結果賦予'resolve'嗎? – ndn