- import 영역
- @Component 영역
- 컴포넌트 클래스 영역
컴포넌트에서 필요한 외부 모듈(모듈 패키지)의 특정 클래스를 사용하기 위해 import필요.
컴포넌트와 관련된 설정 정보를 지정하는 영역이다.
import { Component } from '@angular/core';
@Component({
selector: 'app-root', // 이 컴포넌트를 쓰기위한 명칭 app-root -> index.html 에서 사용
template: `<table>
<tr>
<td><h1>홍길동</h1></td>
</tr>
</table>`, // 화면 구성
styles: [
`
h1 {
color: red;
}
`,
`
h2 {
background: yello;
}
`,
], // 스타일 지정
})
export class AppComponent {
title = 'sample';
}