문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
| angular:style-binding [2019/01/14 08:45] – 만듦 taekgu | angular:style-binding [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ===== Style Binding ===== | ===== Style Binding ===== | ||
| + | <code javascript> | ||
| + | import { Component, OnInit } from ' | ||
| + | |||
| + | @Component({ | ||
| + | selector: ' | ||
| + | template: ` | ||
| + | <h2> | ||
| + | Welcome {{ name }} | ||
| + | </h2> | ||
| + | <h2 [style.color]=" | ||
| + | <h2 [style.color]=" | ||
| + | |||
| + | <h2 [ngStyle]=" | ||
| + | `, | ||
| + | styleUrls: [' | ||
| + | }) | ||
| + | export class TestSbComponent implements OnInit { | ||
| + | |||
| + | public name = " | ||
| + | |||
| + | public successClass = " | ||
| + | public hasError = false; | ||
| + | public isSpecial = true; | ||
| + | public highlightColor = " | ||
| + | |||
| + | public titleStyle = { | ||
| + | color: " | ||
| + | fontStyle: " | ||
| + | } | ||
| + | constructor() { } | ||
| + | |||
| + | ngOnInit() { | ||
| + | } | ||
| + | |||
| + | } | ||
| + | </ | ||