2020. 10. 3. 13:20, Developer
컴포넌트
export class ButtonsComponent implements OnInit {
constructor() { }
test($event:MouseEvent){
console.log($event);
}
ngOnInit(): void {
}
}
HTML
<p>
<button class='startBtn' (click)='test($event)'>시작</button>
<button class='stopBtn'>멈춤</button>
<button class='resetBtn'>리셋</button>
</p>
'Developer' 카테고리의 다른 글
[Angular]부모의 데이터를 자식에게 넘기기 (0) | 2020.10.03 |
---|---|
[Angular]자식의 데이터를 부모에게 넘기기 (0) | 2020.10.03 |
[typescript]타입가드 (0) | 2020.10.02 |
[typescript]Decorator - 파라미터에 decorator 붙혀서 통제하기 (0) | 2020.10.02 |
[typescript]Decorator - property에 decorator 붙혀서 통제하기 (0) | 2020.10.02 |
Comments, Trackbacks