我试图将参数传递给环境文件中的匿名函数,wihch应该替换
${}
传入了参数,但它没有按预期工作,因此我一定是做错了什么。
这是我的档案:
export const environment = {
production: false,
endpoints: {
customer: {
test: (searchTerm: string) => 'http://localhost:7071/api/Customer/SearchCustomerBySearchTerm/${searchTerm}',
},
}
};
const url = environment.endpoints.customer.test('aaa');
${searchTerm}
,我实际上通过了“aaa”。
我错过了什么?