Answer the question
In order to leave comments, you need to log in
Problem when including app.component.ts?
Why does not the file want to be displayed on the page, I created the app.component.html file and connected it to app.component.ts. What could be wrong?
This is app.component.ts.
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: 'app.component.html'
});
export class AppComponent {}
<h1> My first Angular 2 App </h1>
Answer the question
In order to leave comments, you need to log in
the template decorator property is used for the built-in template, and you need to use templateUrl, in addition to this, you have a syntax error, remove the semicolon after the decorator declaration:
@Component({
selector: 'my-app',
templateUrl: './app.component.html'
})
export class AppComponent {}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question