I was following the intruduction tutorial on Webpack for Angular 2: https://angular.io/docs/ts/latest/guide/webpack.html
After finishing all the steps I am getting a 404 error when trying to load the template of the app component.
The tutorial clearly states that the app.component.html and app.component.css should be bundeled on the fly by angular2-template-loader, but they are not, since the browser is trying to request them via XHR.
Code of app.compnent.ts from the tutorial:
import { Component } from '@angular/core';
import '../../public/css/styles.css';
@Component({
selector: 'my-app',
templateUrl: 'app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent { }
It works if I specify the template path relative to the base path, but that is not the right approach.
import { Component } from '@angular/core';
import '../../public/css/styles.css';
@Component({
selector: 'my-app',
templateUrl: './src/app/app.component.html',
styleUrls: ['./src/app/app.component.css']
})
export class AppComponent { }
Does anyone have an idea why this is happening, and is anyone able to complete the tutorial with a working solution?