将TypeScript target设置为ES2015或更低版本。在tsconfig.json中增加以下内容:
{ "compilerOptions": { "target": "ES2015" } }
这将允许Angular正确地使用依赖注入,并避免与ES2022的新特性发生冲突。
上一篇:Angular16信号的副作用
下一篇:Angular16中的http客户端使用字符串(text)响应作为post请求的示例。