本文整理匯總了TypeScript中core/util/templating.replace_placeholders函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript replace_placeholders函數的具體用法?TypeScript replace_placeholders怎麽用?TypeScript replace_placeholders使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了replace_placeholders函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("should ignore extra/unused formatters", () => {
const s1 = tmpl.replace_placeholders("stuff @foo{(0.000 %)}", source, 0, {"quux": "numeral"})
expect(s1).to.be.equal("stuff 1000.000 %")
const s2 = tmpl.replace_placeholders("stuff @foo{(0.000 %)}", source, 1, {"quux": "numeral"})
expect(s2).to.be.equal("stuff 100.200 %")
})
示例2: execute
execute(_cb_obj, cb_data) {
for (const i of get_indices(cb_data.source)) {
const url = replace_placeholders(this.url, cb_data.source, i);
window.open(url);
}
return null;
}
示例3: replace_placeholders
const open_url = (i: number) => {
const url = replace_placeholders(this.url, source, i)
if (this.same_tab)
window.location.href = url
else
window.open(url)
}
示例4: execute
execute(_cb_obj: any, cb_data: {[key: string]: any}): any {
for (const i of get_indices(cb_data.source)) {
const url = replace_placeholders(this.url, cb_data.source, i)
window.open(url)
}
return null
}