@Component({
selector: 'my-app',
templateUrl: './jsonData.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'Angular';
}
It is important to note that the selector should not contain the path in order to be used correctly in HTML templates, for example: <my-app></my-app>
.
When defining the templateUrl
, remember to use the relative path to the HTML template file. In this case, both the component and the template are located in the same folder, so you can simply use ./
followed by the file name.
Additionally, it is recommended to give your files appropriate names such as app.component.ts
, app.component.html
, app.component.css
.
I hope this explanation clarifies any doubts you may have had!