[英]VS Code not indicating that method does not exist in Angular template
[英]VS Code - How to create a method from angular html template?
您可以使用扩展程序My Code Actions v0.6.0。
将其添加到您的settings.json
"my-code-actions.actions": {
"[html]": {
"Create function {{atCursor:$1}}": {
"file": "${fileBasenameNoExtension}.ts",
"atCursor": "\\(click\\)=\"([^\"]+)\\(\\)\"",
"text": "function {{atCursor:$1}}() {\n}\n\n"
}
}
}
如果需要,您可以添加更复杂(多个)的编辑
您可以查看扩展的文档页面,查看添加/修改导入语句的复杂编辑示例。
如果 Angular 模板文件不是 html,请调整languageID
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.