0

In my app.component.ts I import my webservices module as such: enter image description here

But I'm getting red squiggly lines, even though I think I should be importing it correctly. Here's my app structure: enter image description here

Here's my web service module: enter image description here

7
  • it should be import { WebService } from './webservices/webservices' Commented May 7, 2017 at 22:48
  • if you use a "good" IDE, it will suggest the right imports for you automatically. Commented May 7, 2017 at 22:49
  • 1
    @Blauhirn Visual Studio Code has path prediction, If you say it's a bad IDE, you probably never tested it and I recommend you to do so. The issue Amanda_Panda is facing is a common error, to import the folder instead of the file simply because you do not specify the .ts of the files when you import them. Commented May 7, 2017 at 23:05
  • VS Code really is a nice IDE/text editor. And I don't use Windows. Commented May 7, 2017 at 23:08
  • @Ploppy Surely the greatness of an IDE is not determined by its ability to import paths correctly. I didn't know VSC had this bug, but that is good to know and kind of disappointing. Commented May 7, 2017 at 23:26

1 Answer 1

2

Must be:

import {Webservice} from './webservices/webservices.services';
Sign up to request clarification or add additional context in comments.

1 Comment

Making that change still give me the error Cannot find module './webservices/webservices'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.