반응형

disabled

    UI 요소 동적으로 disabled 처리

    ts 파일에 기준이 되는 변수 선언 isenabled:boolean=false; ts 파일에서 상황에 따라 변수 값을 변경 changeAble() { if(input !== '') { //enable the button isenabled=true; } else { //disable the button isenabled=false; } } Html표시 ts에 변수의 값이 변경됨에 따라 view에서 button의 활성화 여부가 결정된다.

반응형