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.

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? "Right-Click > Create a new route" does not exist. Can someone help me further?

WebStorm provides no support for ng generate. If you miss it, please feel free to create a feature request in youtrack. for now I can only suggest using built-in terminal to run ng generate route <route/to/route-component>

By : lena

Make sure you have the Angular plugin (it is called AngularJS even though it supports Angular2.)

In the File / New / AngularCLI menu you can choose "route" to create a new route. You can also assign a shortcut key to open the plugin's Angular CLI dialog.

By : Maor

This video can help you solving your question :)
By: admin