

This will use the Node.js module resolution strategy, instead of TypeScript’s classic module resolution strategy. If you decide to roll up your exports using a barrel index.ts file to import your components (read more about the Barrel technique) then you can use use directory import (Node-style module resolution). For projects that require it, you can instruct WebStorm to calculate import paths relative to the tsconfig.json file location. WebStorm gives you other specialized options to handle your imports. WebStorm will create a new import statement at the top of the document for you, or add the construct to an existing import group that’s using the same source library. WebStorm will either suggest the construct to import through the AutoComplete context menu, or highlight the construct and give you the option to import it by pressing option + enter. What’s fantastic about WebStorm is that you don’t have to type these import statements yourself! When you need to use a construct that would usually be imported, just type it where you need it.

It’s also the method used for projects generated with the Angular CLI. This setting will satisfy most projects and avoid unnecessary path editing. WebStorm and Angular Tip 6: Import Path Calculationīy default, WebStorm will resolve your import paths relative to the file. Let’s explore these tips.īefore we get started: when making changes to settings, remember that WebStorm allows you to change Settings/Preferences at an IDE scope and at a project scope separately. And using WebStorm to look up Angular DocumentationĮach WebStorm and Angular tip will power up your productivity while developing Angular applications in WebStorm.In this second part, Todd shares his personal top seven WebStorm features that allow him to increase his WebStorm and Angular productivity on a daily basis:
PHPSTORM NODE JS SERIES
In this two-part series on WebStorm and Angular, Google Developer Experts Jurgen Van de Moere and Todd Motto share their 12 favorite productivity tips for developing Angular applications using WebStorm. Thank you for supporting the partners who make SitePoint possible. This article on WebStorm and Angular was sponsored by JetBrains.
