Angular code completion and src paths

Why is it WebStorm only finds my src files when I use relative paths in my index.html?

I need to use paths that are relative to my root directory - ie. src="/app/app.js" rather than src="app/app.js"

If I do that though, WebStorm can't resolve the file references and and doesn't know about my angular code.

What do other people do to resolve this?

2 comments
Comment actions Permalink

hi there.

if i am thinking of the same thing i think you are talking about, i believe the solution is in the:

     Preferences, Project Settings part (not the IDE settings part), PHP category

on php 8.0.1 on my mac, at least, you can add paths to the "include paths".

phpStorm (which is what i use) will then also look in those directories for possible files when filename completing.

hope this helps!

0
Comment actions Permalink

WebStorm resolves paths that start with leading slash relative to your project root. If 'app' is not a top-level folder, you can try marking its parent directory as resource root (Mark directory as/Resource root) to make WebStorm resolve paths relative to this parent directory

0

Please sign in to leave a comment.