I am getting the following Unhandled Promise rejection: Failed to load error in my Angular 2 project:
Here is my messages.component.js:
import { Component, OnInit } from "@angular/core"
@Component({
moduleId: module.id,
selector: 'messages',
templateUrl: './messages.component.html',
})
export class MessagesComponent {
messages: object[] = [{ text: "this is some text", owner: "Brad" }, { text: "this is a cool article", owner: "Fred" }];
}
and messages.component.html:
<p>This is the messages Component: {{messages.length}}</p>
<div *ngFor="let message of messages">
{{message.text}} by {{message.owner}}
</div>
I looked at this SO post and this this article the the path looks correct to me.
Towards the end of this post seems to indicate that the html can fail to build and thus be missing. The html file is indeed missing from the wwwroot after building, but I get no compiler errors.
I am on Windows10 using VS2017. I used this template for setting up the project.