0

when i installed the angular it initailly shown me the default angular output.but when i created the header component ,its showimg the error like this..please can anyone resolve my pbm..?

i tried the solutions which was given by stackoverflow,but its not working

import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header',enter code here
templateUrl: `header.component.html
`,
styleUrls: []
})
export class HeaderComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

2 Answers2

0

An Error occurs may be if the path for HTML file is not found. Change this templateUrl in your code

templateUrl: './header.component.html',

and add your component to module.ts file

declarations: [HeaderComponent]
Zarna Borda
  • 615
  • 1
  • 3
  • 22
0

Provide relative path instead of absolute path.

As in if your html is in the same folder

templateUrl: `./header.component.html'

instead of

templateUrl: `header.component.html`
Eeshwar Ankathi
  • 242
  • 3
  • 11