Angular를 사용하다가 jquery 및 JS 라이브러리를 사용해야할 때가 있다. 그럴 때 구글에 검색하면 여러가지 방법이 있지만 나는 여러가지를 사용해도 안되서 찾다가 결국 해결했다. 1. 일반적인 Angular에서 jquery 사용방법 1) npm에서 jquery 설치 npm install--savejquery && npm install -D @types/jqueryimport* as$ from 'jquery';사용할컴포넌트에 declare var $:any; 2) jquery cdn이나 file import 1. Angular cli를 이용해 프로젝트를 생성할 경우 index.html 에다가 추가 2. declare var$: any; 2. JS library 사용법 - spa (Single Pa..
angular는 컴포넌트 형식이라 모든 부분이 컴포넌트로 이루어져있다. 그런 컴포넌트 끼리 데이터를 주고받을 때 사용하는것이 Component Communication이다. 1. @ViewChild와 @ViewChildren 컴포넌트 템플릿에 배치된 자식요소(자식 컴포넌트, 디렉티브, 네이티브 DOM 요소)를 ViewChild라고 한다. 이름에서 알 수 있듯이 @ViewChild는 탐색 조건에 부합하는 1개의 요소를 취득할 수 있고, @ViewChildren는 탐색 조건에 부합하는 여러개의 요소를 한꺼번에 취득할 수 있다. @ViewChild(탐색대상 클래스명) 프로퍼티명: 탐색대상 클래스명; @ViewChildren(탐색대상 클래스명) 프로퍼티명: QueryList; 2. 변수값전달 (왼쪽부터) 1. ..
Angular에서 template에서 배열의 데이터를 표현하기 위해 사용하는 [ngFor] 라는 지시자(Directive)가 있다. Angular 공식 홈페이지에서 나오는 ngFor에 대한 설명은 다음과 같다. @Directive({ selector: '[ngFor][ngForOf]' }) class NgForOf implements DoCheck, OnChanges { constructor(_viewContainer: ViewContainerRef, _template: TemplateRef, _differs: IterableDiffers) ngForOf: NgIterable ngForTrackBy: TrackByFunction set ngForTemplate: TemplateRef ngOnChanges..
Angular 를 사용하다 보면 양방향 바인딩을 사용하는 [(ngModel)]을 자주 사용할 것이다. 사용법은 [(ngModel)]="data" 이런식으로 데이터를 제어할 때 사용하는데 양방향을 사용하기 때문에 html의 이나 그외 버튼 이런거를 사용할 때마다 값을 변경할 때 유용하다. 하지만 data 뿐만아니라 함수 호출을 사용하고싶은 때 에는 어떻게 사용해야하나? 그럴 때 ngModelChange 를 사용하면 된다. 사용법은 이런식으로 사용한다. 위의 예제로는 select 를 선택할 때마다 (ngModelChange)="changeValueNum1($event)" 이 호출된다.
- Total
- Today
- Yesterday
- JPA
- facebook login
- Java
- data component
- angular router
- react
- data table component
- Spring Boot
- data gird component
- Router
- 파이썬3
- Spring
- https://www.tistory.com/auth/logout/
- JSON
- mobx
- Angular
- MySQL
- localStorage
- data grid component
- 페이스북 로그인
- 파이썬
- React-router
- Redux
- JavaScript
- CSS
- Python
- data component module
- python3
- jQuery
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |