简体   繁体   English

Angular CLI(Angular2)和WebStorm:如何在WebStorm中创建路由?

[英]Angular CLI (Angular2) and WebStorm: How can I create a route within WebStorm?

WebStorm (Version >= 2006.2.EAP) provides Angular-CLI to create new Angular2 Projects out of the box. WebStorm(版本> = 2006.2.EAP)提供Angular-CLI来开箱即用地创建新的Angular2项目。

The question now is: How can I create a new route (with all the necessary files: component, html-tpl, spec.ts, e2e.specs, etc..) on the fly within WebStorm? 现在的问题是:如何在WebStorm中动态创建新路由(包含所有必需的文件:component,html-tpl,spec.ts,e2e.specs等)? "Right-Click > Create a new route" does not exist. “右键单击>创建新路线”不存在。 Can someone help me further? 有人可以进一步帮助我吗?

WebStorm provides no support for ng generate . WebStorm不支持ng generate If you miss it, please feel free to create a feature request in youtrack . 如果您错过了它,请随时在youtrack中创建功能请求。 for now I can only suggest using built-in terminal to run ng generate route <route/to/route-component> 目前,我只能建议使用内置终端运行ng generate route <route/to/route-component>

Make sure you have the Angular plugin (it is called AngularJS even though it supports Angular2.) 确保您具有Angular插件(即使它支持Angular2,也称为AngularJS。)

In the File / New / AngularCLI menu you can choose "route" to create a new route. 在文件/新建/ AngularCLI菜单中,您可以选择“路线”以创建新路线。 You can also assign a shortcut key to open the plugin's Angular CLI dialog. 您还可以分配一个快捷键,以打开插件的Angular CLI对话框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM