I tried to access a custom built html using templateUrl in Angular2.
Here is my login.component.ts
import {Component} from '@angular/core';
@Component({
selector: 'login' ,
templateUrl : './login.component.html'
})
export class loginComponent{
}
Here is my login.component.html
<div class="container">
<input type="text" placeholder="username">
<input type="text" placeholder="password">
<button>Login</button>
</div>
My directory structure has both the login.component.ts and login.component.html both in the same location.
When I compile this code I am getting an error stating
localhost:8081/login.component.html not found 404
Unhandled Promise rejection: Failed to load login.component.html ; Zone: ; Task: Promise.then ; Value: Failed to load login.component.html undefined
login.component.htmlat root level? You're getting a 404, meaning it can't find the page atlocalhost:8081/login.component.html. - Obsidian Age