Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- summary
- 검색
- 옵저버블
- angular animation
- Angular Router
- egov spring ajax 사용 예시
- flex-1
- modal
- 스크롤 이벤트
- prisma
- Ionic modal
- 스크롤 이벤트 감지
- 호버
- scroll
- 앵귤러 모달
- 아이오닉 스크롤 이벤트
- 앵귤러 애니메이션
- angular route
- angular modal
- ApexChart
- TAILWIND
- Router
- formgroup
- 모달
- mysql if
- route
- Oracle LISTAGG 사용 예시
- angular button
- 셀렉트박스 커스텀
- ajax 사용 예시
Archives
- Today
- Total
깜놀하는 해므찌로
Angular oninput 사용 예시 / 이메일 정규식 본문
반응형
SMALL
<div [title]="inputSet.title" [class]="inputSet.class">
<input #inputRef type="text" [id]="inputSet.id" [maxLength]="inputSet.maxlength"
oninput="test = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i.test(this.value)">
</div>
1. oninput 속성은 (oninput) 으로 사용하면 함수를 못찾으므로 직접 정규식을 HTML 에 넣고 결과값을 받아 해당 값을 컴포넌트에서 처리하도록 합니다.
<div [title]="inputSet.title" [class]="inputSet.class">
<input #inputRef type="text" [id]="inputSet.id" [maxLength]="inputSet.maxlength"
(input)="isEmail($event)">
</div>
2. (input) 사용하면 oninput. 동일하게 작동합니다.
반응형
LIST
'IT' 카테고리의 다른 글
HTML details summary 예시 (0) | 2023.04.18 |
---|---|
Angular property bind 앵귤러 프로퍼티 바인딩 (0) | 2023.04.17 |
전화번호 정규식 자동 '-' hyphen 처리 (0) | 2023.04.17 |
dayJs (0) | 2023.04.17 |
Angular typescript 검색 기능 예시 ts / Date 날짜 비교 (0) | 2023.04.16 |