0

Am just taking baby steps in Angular-2, have gone through 5-min quick start and ScothIO example. Am trying an example with Components and Services, i cant even bring up my application when i fire npm start command.

I get following error :

app/app.ts(5,33): error TS2307: Cannot find module '/app/family.component'.
app/app.ts(6,31): error TS2307: Cannot find module '/app/family.service'.
app/family.component.ts(2,31): error TS2307: Cannot find module 'app/family.service'.

I understand the fact that Angular / TypeScript is unable to find family.component and family.service when its trying to compile but all the Import paths seem to be correct for me as it worked all fine in the 5-min quick start example when tried.

Here is the Plunker link which has all code files

Please help me out in rectifying this Compile exception.

6
  • 1
    plnkr.co/edit/PMt6BvYMw69BSvocvOmT?p=preview Commented Jul 26, 2016 at 12:26
  • @micronyks : can u plz tell what changes have u done in plunker link u provided ? I see all files being same except few changes in systemjs.config.js Commented Jul 26, 2016 at 16:27
  • Yes I changed systemjs.config.js. Commented Jul 26, 2016 at 16:28
  • @micronyks no luck sir. I assumed the only change in systemjs.config.js was 'app':{ main: 'app.ts', defaultExtension: 'ts' }, where i had used .js earlier. If there r any more changes please let me know. Commented Jul 26, 2016 at 17:49
  • What are doing? are you playing with ES6/6 or Typescript? Commented Jul 26, 2016 at 17:56

1 Answer 1

2

the path in your app.ts is incorrect for family.component and family.service...

just change the path from app/family.component to just ./family.component

changes:-

app/family.component ==> ./family.component

app/family.service ==> ./family.service

this will solve your problem :)

Sign up to request clarification or add additional context in comments.

Comments

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.