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
- 아이오닉 스크롤 이벤트
- modal
- Ionic modal
- Router
- ApexChart
- angular modal
- TAILWIND
- ajax 사용 예시
- prisma
- 셀렉트박스 커스텀
- egov spring ajax 사용 예시
- 모달
- angular animation
- Oracle LISTAGG 사용 예시
- 옵저버블
- mysql if
- 앵귤러 모달
- Angular Router
- route
- formgroup
- scroll
- angular route
- 스크롤 이벤트
- flex-1
- 검색
- angular button
- 스크롤 이벤트 감지
- 호버
Archives
- Today
- Total
깜놀하는 해므찌로
Ionic & component 데이터 이동 예시 on Angular 본문
반응형
SMALL
import { Component } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ModalPage } from '../modal/modal.page';
@Component({
selector: 'modal-example',
templateUrl: 'modal-example.html',
styleUrls: ['./modal-example.css']
})
export class ModalExample {
constructor(public modalController: ModalController) {
}
async presentModal() { // 모달 열기 메소드
const modal = await this.modalController.create({
component: ModalPage // 연결할 페이지 컴포넌트, 템플릿
});
return await modal.present();
}
}
1. 페이지 컴포넌트
import { Component, Input } from '@angular/core';
import { NavParams } from '@ionic/angular';
@Component({
selector: 'modal-page',
})
export class ModalPage {
constructor() {
}
}
2. 모달 컴포넌트 : 데이터 받기 위해 심볼 로드합니다.
async presentModal() {
const modal = await this.modalController.create({
component: ModalPage,
componentProps: {
'key': 'value',
'key': 'value',
}
});
return await modal.present();
}
3. 페이지 컴포넌트에 모달을 생성과 동시에 전달할 데이터를 설정합니다.
export class ModalPage {
// Data passed in by componentProps
@Input() firstName: string;
@Input() lastName: string;
@Input() middleInitial: string;
constructor(navParams: NavParams) {
// componentProps can also be accessed at construction time using NavParams
console.log(navParams.get('firstName'));
}
}
4. 모달 페이지에서 생성과 동시에 값을 가져올 수 있습니다.
반응형
LIST
'IT' 카테고리의 다른 글
Angular typescript 검색 기능 예시 ts / Date 날짜 비교 (0) | 2023.04.16 |
---|---|
C언어 전역변수 활용 예시 (0) | 2023.04.16 |
LocalStorage 활용 예시 / Angular (0) | 2023.04.14 |
Ionic radio 활용 예시 *ngFor (0) | 2023.04.14 |
Angular Router 앵귤러 라우터 작성 방법 (0) | 2023.04.14 |