0

I'm using WebStorm 2016.3 to create an Angular 2 Project. I've followed this post to bundle my project: https://angular.io/docs/ts/latest/guide/webpack.html

When I typed command npm start it showed me a list of errors:

Module not found

I've changed templateUrl in every file to src/components/<template url> but it still showed those errors.

Can anyone help me please ?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Redplane
  • 2,971
  • 4
  • 30
  • 59

1 Answers1

1

try this: ../views/main-application.html

The url is starting relative to the current path of your .ts file. So you need to navigate up first.

littleStudent
  • 127
  • 1
  • 4
  • Your answer worked. Please help me with: ERROR in ./src/components/views/shared/navigation-bar.component.ts Module not found: Error: Can't resolve '../views/shared/navigation-bar.component.html' in 'F:\Programming\DotNet\Web\Fullstack\ASP.NET Core\iConfess\A-SOURCE_CODE\B-CLIENT\A-WEB\Adminis tration\src\components\views\shared' @ ./src/components/views/shared/navigation-bar.component.ts 26:22-78 @ ./src/modules/main-application.module.ts @ ./src/main.ts @ multi (webpack)-dev-server/client?http://localhost:3000 ./src/main.ts – Redplane Feb 22 '17 at 17:08
  • I think you should read up on `file paths` ;). In cases where the files are in the exact same folder, use this: `./navigation-bar.component.html` – littleStudent Feb 23 '17 at 12:06