plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

500 error when using templateUrl in Angular template #37

Open Prontsevich opened 6 years ago

Prontsevich commented 6 years ago

I've created a new project with Angular template. Then I created 2 files in lib folder: app.component.ts and app.component.html. app.component.ts: import { Component, VERSION } from '@angular/core';

@Component({ selector: 'my-app', templateUrl: 'app.component.html' })

export class App { name: string; constructor() { this.name =Angular! v${VERSION.full}; } }

app.component.html: <div> <h2>Hello {{name}}</h2> </div>

app.ts: import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser';

import { App } from './app.component';

@NgModule({ imports: [BrowserModule], declarations: [App], bootstrap: [App], }) export class AppModule {}

And I'm getting image

ggoodman commented 6 years ago

Looks like an issue with how SystemJS resolves relative paths vs Angular's assumptions. Here's a work-around that the Angular team seems to have created that I'll look to incorporate: https://github.com/angular/quickstart/blob/master/src/systemjs-angular-loader.js