본문 바로가기 메뉴 바로가기

개발과 취미

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

개발과 취미

검색하기 폼
  • 분류 전체보기 (22)
    • Javascript (5)
      • 비동기 프로그래밍 (5)
    • Angular8 (13)
    • 주식 모으기 (1)
  • 방명록

Angular8 (13)
[Angular] ngClass 동적으로 class 변경하기

ngClass는 ngStyle과 동작방식이 비슷하다. style과 다르게 class 명을 동적으로 바꿔 준다고 생각하면 된다. test.component.css .blue { color: blue; font-size: 20px; } .red { color: red; font-size: 30px; } 미리 설정한 css 클래스이다 import { Component, OnInit, ViewChild } from '@angular/core'; @Component({ selector: 'app-test', templateUrl: './test.component.html', styleUrls: ['./test.component.css'] }) export class TestComponent implements O..

Angular8 2020. 4. 7. 18:17
이전 1 2 3 4 5 ··· 13 다음
이전 다음

Blog is powered by Tistory / Designed by Tistory

티스토리툴바