WebStorm Angular 2 实时模板弹出完成工作错误

WebStorm Angular 2 live templates popup completion works wrong

我安装了 ng2-webstorm-snippets 并且当我开始输入片段代码时(针对 example a-route-path-eager)WebStorm 会通过其默认选项覆盖代码完成弹出窗口

我录制了一张动图:

我能做什么?

这很可能只是因为存在 appRoute Const(如上定义),它在您尝试插入现场模板。 在其他情况下,这可能会起作用。 由于实时模板的缩写是 "a-route-path-eager" 我的建议是输入“a-route" 或者只有 "route" 而不是 "aroute" 当试图插入 live模板。

您始终可以在键入实际缩写(甚至在处理中)之前调用 Code | Insert Live Template...Ctrl + J,在 Windows 上使用默认键盘映射)。这将仅列出 Live Templates 而没有其他内容(因此不会干扰 classes/variable/etc)。

当前的行为可能是由于缩写中包含 - 个符号,而您并未键入(不是 100% 确定,但 IMO 的可能性很高)。