Ionic ๋ฒ์ : ("x"๋ก ํ๋ ์ ํ)
[ ] 1.x
[x] 2.x
์ ์ถ ์ค์
๋๋ค ... ( "x"๋ก ํ๋ ์ ํ)
[x] ๋ฒ๊ทธ ๋ณด๊ณ ์
[ ] ๊ธฐ๋ฅ ์์ฒญ
[ ] ์ง์ ์์ฒญ => ์ฌ๊ธฐ์ ์ง์ ์์ฒญ์ ์ ์ถํ์ง ๋ง๊ณ ๋ค์ ์ฑ๋ ์ค ํ๋๋ฅผ ์ฌ์ฉํ์ญ์์ค. https://forum.ionicframework.com/ ๋๋ http://ionicworldwide.herokuapp.com/
ํ์ฌ ํ๋:
virtualScroll ๋ฐ ion-img๋ฅผ ์ฌ์ฉํ ๋ ์๋๋ก ์คํฌ๋กคํ ํ(๋ฒํผ๊ฐ ์ข
๋ฃ๋ ๋) ion-img๊ฐ ์ด๋ฏธ์ง ๋ก๋๋ฅผ ์ค์งํฉ๋๋ค.
์ฝ๋ ๊ฒ์ฌ๊ธฐ๋ฅผ ์ดํด๋ณด์ญ์์ค.
(๋ด ๋ก์ปฌ ์ปดํจํฐ์ ๊ฒฝ์ฐ) ์ ํํ๊ณ ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์์๋๋ ๋์:
ion-img๋ ์ด๋ฏธ์ง๋ฅผ ๋ก๋ํด์ผ ํฉ๋๋ค.
์ฌํ ๋จ๊ณ:
๊ด๋ จ ์ฝ๋:
<ion-content>
<ion-refresher (ionRefresh)="dataService.refresh($event)">
<ion-refresher-content
pullingText="ะะพััะฝะธัะต ะดะปั ะพะฑะฝะพะฒะปะตะฝะธั"
refreshingText="ะะฐะณััะทะบะฐ">
</ion-refresher-content>
</ion-refresher>
<ion-list [hidden]="(works|filterWorks:filter.price.mode:filter.price.from:filter.price.to:filter.price.currency_id:filter.location.mode:filter.added.mode:sort.orderBy:commonData).length==0" [virtualScroll]="works|filterWorks:filter.price.mode:filter.price.from:filter.price.to:filter.price.currency_id:filter.location.mode:filter.added.mode:sort.orderBy:commonData" approxItemHeight="80px" >
<ion-item-sliding *virtualItem="let work">
<button ion-item (click)="goWork(work)" [ngClass]="{'work-list-item-selected':selectedWorks.works[work.id]}">
<ion-thumbnail item-left>
<ion-img [src]="work.image|defaultImage"></ion-img>
</ion-thumbnail>
<h3>{{commonData.authors[work.author_id]?.title}}</h3>
<h5>{{work.title}}</h5>
<p class="work-list-price">{{work.price | price : work.price_currency_id : commonData.currencyExchangeRate : true}}</p>
<p>{{work.year ? work.year+',':''}} {{work.techniques | techniques : commonData.techniques : commonData.mainLanguageId}}</p>
</button>
<ion-item-options side="left">
<button ion-button icon-only color="primary" (click)="selectedWorks.toggle(work)">
<ion-icon name="{{selectedWorks.works[work.id] ? 'checkmark-circle':'radio-button-off'}}"></ion-icon>
</button>
</ion-item-options>
<ion-item-options side="right">
<button ion-button icon-left color="primary" (click)="sendWorkByEmail(work)">
<ion-icon name="mail"></ion-icon>
Email
</button>
</ion-item-options>
</ion-item-sliding>
</ion-list>
</ion-content>
๊ธฐํ ์ ๋ณด:
๋ฒ๊ทธ๋ RC4์์ ๋ํ๋ฌ๊ณ RC3์์๋ ๋ชจ๋ ์ ์์ด์์ต๋๋ค.
Ionic ์ ๋ณด: (ํฐ๋ฏธ๋/cmd ํ๋กฌํํธ์์ ionic info
๋ฅผ ์คํํ๊ณ ์ถ๋ ฅ์ ์๋์ ๋ถ์ฌ๋ฃ๊ธฐ):
Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v4.2.6
Xcode version: Not installed
rc4๋ก ์ ๋ฐ์ดํธํ ํ ๋ด ์ฑ์ ๋์ผํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
๋๋ RC 4์์ ๋น์ทํ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์๋๋ฐ RC 3์์๋ ์ ์๋ํ์ต๋๋ค.
๋ด ์ชฝ์์๋ ๊ฐ์ ๋ฌธ์
"ion-img"๋์ "img"๋ฅผ ์ฌ์ฉํด๋ณด์ญ์์ค. ๋๋ฅผ ์ํด ์ผํ๋ค.
"ion-img"๋ rc4์์๋ ์๋์ ๋ฉ์ท์ต๋๋ค(๊ฐ์ ์คํฌ๋กค ์์ด๋). "img"๋ก ๋ฐ๊พธ๋ฉด ๋ ๊ธด ๋ชฉ๋ก์์ ์ผ๋ถ ์ฑ๋ฅ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ต๋๊น?
@sajTemler ์ ์๋ํ์ง๋ง ion-img์ ํจ๊ป ์ ๊ณต๋๋ ์ง์ฐ ๋ก๋ฉ๊ณผ ๊ฐ์ ์ฑ๋ฅ ์ด์ ์ ์์ต๋๋ค.
ng2 ์ง์ฐ ๋ก๋๋ฅผ ๊ณ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. 2๊ฐ ์ด์์ด ์์ต๋๋ค. ๋๋ ์ด๊ฒ์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค https://github.com/tjoskar/ng2-lazyload-image
์ฐจ์ค ์ฌ๋ฌ๋ถ,
ion-img๋ ํ๊ทธ๊ฐ ๋ณด์ด๋ ์ฝํ
์ธ ์ ์๋ ๊ฒฝ์ฐ์๋ง ์ ๋๋ก ์๋ํฉ๋๋ค. ๋ชจ๋ ๋ชฉ๋ก, ์ธ๊ทธ๋จผํธ ๋ฑ .... ์๋ํ์ง ์์ต๋๋ค.
๋ด ์์ ์์ ์ฌํญ:
๋ค์์ ์ฌ์ฉํ์ฌ ngAferContentInit ๊ธฐ๋ฅ์ ๋ณ๊ฒฝํ์ญ์์ค.
Img.prototype.ngAfterContentInit = ํจ์() {
var _this = ์ด๊ฒ;
this._img = this._elementRef.nativeElement.firstChild;
if(!this._img.hasAttribute("src")){
this._img.src=this._elementRef.nativeElement.getAttribute("src");
}
this._unreg = this._platform.addEventListener(this._img, 'load', function () {
_this._hasLoaded = true;
_this.update();
}, { passive: true });
};
Ionic ํ์ ๋น ๋ฅธ ์์ ์ ๋ฐ๋๋๋ค. :)
์ฌ๋ฌ๋ถ ์๋ ํ์ธ์! Ionic์ ์ฌ์ฉํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค! ๋๊ตฐ๊ฐ ์ด ๋ฌธ์ ๋ฅผ ์ฌํํ๋ ๋ฐ ์ฌ์ฉํ ์ ์๋ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ๊ฒ์ํ ์ ์์ต๋๊น?
@jgw96 ์ํ์ ์ด๋ฉ์ผ๋ก ๋ณด๋์ต๋๋ค
์ฌ์ ํ ๋ฌธ์ ๊ฐ ์์ต๋๊น? "ion-img"๊ฐ ๋ด ์ฑ์์ ์์๋๋ก ์๋ํ์ง ์์ง๋ง ์ ์ ๋์ ์ค๋ช ์ ์ฐพ์ ์ ์์ต๋๋ค
์ฌ๊ธฐ๋ ๋ง์ฐฌ๊ฐ์ง์ ๋๋ค. ํด๊ฒฐ๋์๋์?
@naveedahmed1 ์ฌ๊ธฐ์ ์ํ์ ๊ฒ์ํ ์ ์์ต๋๊น? ๋๋ ์ฐ๋ฆฌ๊ฐ ๊ฐ์ ๋ฌธ์ ์ ๋ํด ์ด์ผ๊ธฐํ๊ณ ์๋์ง ํ์คํ์ง ์์ต๋๋ค.
non-virtualScroll ๊ทธ๋ฆฌ๋์์๋ ์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. plunker ์์ ๋ฌธ์ ๋ฅผ ์ฌํํ์ต๋๋ค. ์ ํํ(non-virtualScroll) ๋ชฉ๋ก์์ ์ ๋๋ก ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ion-infinite-scroll์ ๋ชฉ๋ก์ ์ถ๊ฐ ํ ๋๋ง๋ค ion-images๋ ๋ก๋ฉ ๋ฐ ์ธ๋ก๋ฉ ๋ฌธ์ ๋ฅผ ๋ณด์ฌ์ค๋๋ค.
๋ฐ๋ผ์ '์ผ๋ฐ' ๋ชฉ๋ก์ด ์ ๋๋ก ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. virtualScroll ๋๋ InfinityScroll์ด ์๋ ๋ชฉ๋ก์ ๋ฌธ์ ๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
RC5 - ๋์ผํ ๋ฌธ์
๋ถ๋ช
ํ ion-img๋ virtualScroll๊ณผ ํจ๊ป ์ฌ์ฉํด์ผ ํฉ๋๋ค.
https://github.com/driftyco/ionic/commit/a5bbbd55cbd0e256614b6a1062aabbab4b1f21bd
๋๋ @pavimus ์ ์ ํํ ๊ฐ์ ํ๋์ํฉ๋๋ค.
๊ฐ์ ์คํฌ๋กค ๋ฒํผ ํ์ ์ด๋ฏธ์ง๊ฐ ๋ํ๋์ง ์๊ณ CSS ํด๋์ค๊ฐ "img-unloaded"์ ๋๋ค(์๋ ์คํฌ๋ฆฐ์ท ์ฐธ์กฐ).
์ด์จ 2 ํ์ด๋๊ณผ ํจ๊ป. ์ด ๋ฌธ์ ์ ๋ํด ์์ฌ ์ํตํ ์ ์์ต๋๊น?
์ต์ ionic์๋์ด ๋ฒ๊ทธ๊ฐ ์์ต๋๋ค.
์คํฌ๋กค ๊ฐ๋ฅํ ์ด๋ฏธ์ง ๊ทธ๋ฆฌ๋(๊ฐ์ ์คํฌ๋กค์ด ์๋ ์ด์จ ๊ทธ๋ฆฌ๋)์์ ์๋ํ๊ธฐ ์ํด ์ด๊ฒ์ด ์ ๋ง๋ก ํ์ํ๊ธฐ ๋๋ฌธ์ ํ๋ก์ ํธ์ <project_root>/node_modules/ionic-angular/components/img/img.js
ํ์ผ์ ์ผ์์ ์ผ๋ก ์ด ์์ง ๋ก ๋์ฒดํ์ต๋๋ค.
์ฃผ๋ณ์ ํํค์น ํ ion-img์ _top_ ๋ฐ _bottom_์ด ์ปจํ ์ด๋์ ์ ๋ ์๋จ์ ์๋์ ์ด์ง ์์ ์๋ชป๋ ์ด๋ฏธ์ง๊ฐ ๋ก๋/์ธ๋ก๋๋๋ ๊ฒ์ผ๋ก ๋ํ๋ฌ์ต๋๋ค. ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์์ง์ 231 ํ๊ณผ 242 ํ์ ์ฐธ์กฐํ์ญ์์ค.
์ฐ๋ฆฌ๋ ๋ํ ion-img ํ์ฅ์ ์๋ํ์ง๋ง ๋ง์ ์ฑ๊ณต์ ๊ฑฐ๋์ง ๋ชปํ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ Ionic dist ํ์ผ์ (์์) ์ฌ์ฉ์ ์ ์ ๋ฒ์ ์ ๊ตฌ์ถํ๊ณ ์ด๋ฅผ ๋ก์ปฌ ์ข ์์ฑ์ผ๋ก ์ฌ์ฉํ๋ ๊ฒ๋ ์๊ฐ๋ณด๋ค ๋ณต์กํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค. ๋ฐ๋ผ์ Ionic ํ์ด ์ด ์์ ์ ์ํํ๋ ๋์ ์ด ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ ๊ฒ์ ๋๋ค.
@sajTemler ํด๋น ํ๋ฌ๊ทธ์ธ์ผ๋ก ์คํฌ๋กค์ด ๋ฉ์ถ ๊ฒฝ์ฐ์๋ง ์ด๋ฏธ์ง๋ฅผ ๋ก๋ํ ์ ์์ต๋๊น?
์ด ๋ฒ๊ทธ ๋ฐ ๊ธฐํ ๋ช ๊ฐ์ง(ํฌ๋กฌ/์๋๋ก์ด๋์์ ์๋ตํ์ง ์๋ ์ด๋ฏธ์ง ๋ฐ 5x5๋ง, ์คํฌ๋กคํ๊ธฐ ์ ์ ์ฒ์ ์์ํ ๋ ์ด๋ฏธ์ง๊ฐ ๋ก๋๋์ง ์์..)๋ ์ง์ฐ ๋ก๋๋ ์ด๋ฏธ์ง๊ฐ ์๋ ๊ธฐ์ฌ ํ์์ ํฌ๊ฒ ์์กดํ๋ ํ๋ก๋์
์ฑ์ ์ค๋จํ์ต๋๋ค.
๊ทธ๋ฌํ ๋ณ๊ฒฝ ์ฌํญ์ ๋ํ ๋ฌธ์๋ฅผ ์ป์ง ๋ชปํ ๊ฒ์ด ์ข์ต๋๋ค. ์ด๊ฒ์ ์๋ก์ด ์์์ด ์๋๋๋ค.
@ventr1x ์ด ์น๋ช ์ ์ธ ๋ฒ๊ทธ๊ฐ 12์ 16์ผ๋ถํฐ ์์ง ์ด๋ ค ์๊ธฐ ๋๋ฌธ์ ๊ฐ๋ฐ์๋ค์ ๋ฌด์์ ํ๊ณ ์๋์ง ๊ถ๊ธํฉ๋๋ค.
๊ทธ๊ฒ์ ๋จ์ง ๊นจ์ ธ ์์ต๋๋ค(์ค์ ๋ก ์๋ํ ์ ์ด ์์ผ๋ฉฐ ๋ฒ ํ์์๋ ์ด๋ค ๋ฌธ์์์๋ ์ธ๊ธ๋์ง ์์์ต๋๋ค).
๋๋ ng2-lazyload-image๋ก ์ ํํ๊ณ rc6๊ณผ ๊ฐ์ด ์๋ํ๋๋ก ํ์ต๋๋ค(์ผ๋ถ๋ ๋ฌธ์ํ๋์ง ์์ ๋์ผํ ์์ ์ ๊ฑฐ์น์ง ์์ ์ ์์ต๋๋ค.):
์์
import { Component, ViewChild } from '@angular/core';
import { Content } from 'ionic-angular';
@Component({
templateUrl: 'image-modal.html'
})
export class ImageModal {
@ViewChild(Content) content: Content;
constructor() {
}
}
๋ณด๋ค
<img [src]="img" [lazyLoad]="img" [scrollObservable]="content.ionScroll" />
@ventr1x ์ฌ์ฉ์๊ฐ ์ด ํ๋ฌ๊ทธ์ธ์ผ๋ก ์คํฌ๋กค์ ๋ฉ์ท์ ๋๋ง ์ด๋ฏธ์ง๋ฅผ ๋ก๋ํ ์ ์๋์?
@jgw96 ์ํ ์ ๋ฐ์ดํธ๊ฐ ์์ต๋๊น?
์ฌ๊ธฐ์๋ ๊ฐ์ ๋ฌธ์ ..
ion-img
๋ฅผ segment
$ ์์ ๋ฃ์ผ๋ฉด ๋ก๋๋์ง ์์ต๋๋ค.
http://plnkr.co/edit/Zb2EQQVCFgdyZ1CRfPsW?p=preview
https://github.com/shprink/ionic-withwebworker-vs-withoutwebworker ์์ Ionic 3.1.1๋ก ์ฝ๊ฒ ์ฌํํ ์ ์์ต๋๋ค.
์ด๊ฒ์ ๋ฌธ์ ์ ๊ด๋ จ์ด ์์ง๋ง @shprink ์น ์์ ์ ์์ ์์ ํ ์ด์จ ์ฑ์ ์คํํ ๋ฐฉ๋ฒ์ ์ฐพ์์ต๋๊น?
์์ง @naveedahmed1 ๊ณผ ๊ฐ์ ๊ฒ์ ์๋ํ์ง ์์์ต๋๋ค.
์๊ฒ ์ต๋๋ค. ๊ณต์ ํ ๋งํฌ์ URL์ webworker๊ฐ ์์ผ๋ฏ๋ก ์๋ํด ๋ณด์ จ์ ๊ฑฐ๋ผ ์๊ฐํฉ๋๋ค. ๋ฐฉ๊ธ ์๋น์ค ์์ปค๋ฅผ ์ฌ์ฉํ๊ณ ์๋์ง ํ์ธํ์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ถํํ๋ ์๋น์ค ์์ ์๋ ์ฅ์น์์ ์ง์๋์ง ์์ง๋ง ์น ์์ ์๋ ์ฅ์น์์๋ ์๋ํฉ๋๋ค.
๊ฐ์ ์คํฌ๋กค ๋ด์ ion-img
๋ ์น ์์
์์์ img
๋ฅผ ๋ก๋ํด์ผ ํ๋ฏ๋ก ์ ๋ชฉ์ ์์ต๋๋ค.
ion-img
๋ฅผ img
๋ก ๋ฐ๊ฟจ๊ณ ๊ฐ์ ์คํฌ๋กค ๋ด์์ ion-img ๋์ img ๋ฅผ ์ฌ์ฉํ์ฌ ์ ๋๋ก ์๋ํฉ๋๋ค.
๋ฌธ์์ ๋ฐ๋ฅด๋ฉด ์ฑ๋ฅ์์ ์ด์ ๋ก ion-img
๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค( https://ionicframework.com/docs/api/components/virtual-scroll/VirtualScroll/ ์ฐธ์กฐ).
๋ฐ๋ผ์ $# ion-img
img
๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ์๊ตฌ์ ์ธ ํด๊ฒฐ์ฑ
์ด ๋ ์ ์์ผ๋ฉฐ ์ด ์ค๋ ๋ฒ๊ทธ๊ฐ ๊ณง ์์ ๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
@manucorporat ์์ง ์ด ๋ฌธ์ ์ ์ง์ ์ด ์์ต๋๊น?
+1
๋๋ ๋ํ์ด ๋ฌธ์ ๊ฐ ์์๋ค. ๋ฒ๊ทธ๋ ion-img์์ img::top
๋ฐ img::bottom
์ ๊ณ์ฐ์
๋๋ค. ์ด๊ฒ์ ์คํฌ๋กคํ๋ ๋์ ion-img
$์ ๋ํด $ Content::updateImgs
ํ๋๊ทธ canRequest
๋ฐ canRender
๋ฅผ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.
๋ด ์ฒซ ๋ฒ์งธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๊ฐ์ ๋ชฉ๋ก์ ๋ํด ion-img
๋ฅผ ํ์ฅํ๋ ๊ฒ์ด์์ต๋๋ค.
import {Component, ElementRef, Renderer, Optional} from "@angular/core";
import {Img, Platform, DomController, Content} from "ionic-angular";
@Component({
selector: 'virtual-ion-img',
template: '<img>'
})
export class VirtualIonImg extends Img {
constructor(private __elementRef: ElementRef,
__renderer: Renderer,
__plt: Platform,
@Optional() private __content: Content,
__dom: DomController) {
super(__elementRef, __renderer, __plt, __content, __dom);
}
get top(){
this._rect = (<HTMLElement>this.__elementRef.nativeElement).getBoundingClientRect();
return this._rect.top + this.__content.scrollTop - this.__content._cTop;
}
get bottom(){
this._rect = (<HTMLElement>this.__elementRef.nativeElement).getBoundingClientRect();
return this._rect.bottom + this.__content.scrollTop - this.__content._cTop;
}
}
๋ ๋ค๋ฅธ ์ต์
์ ํ์ด์ง์์ ์ด ํจ์๋ฅผ ์ฌ์ ์ํ์ฌ Content::imgsUpdate
์ ๊ณ์ฐ์ ์์ ํ๋ ๊ฒ์
๋๋ค.
import {updateImgs} from "ionic-angular/components/content/content";
import {Component, ViewChild} from "@angular/core";
import {Content} from "ionic-angular";
@Component({
templateUrl: 'virtual-list.html',
})
export class VirtualListPage {
@ViewChild(Content) _content: Content;
ngAfterViewInit(){
if(this._content) {
this._content.imgsUpdate = () => {
if (this._content._scroll.initialized && this._content._imgs.length && this._content.isImgsUpdatable()) {
// reset cached bounds
this._content._imgs.forEach((img:Img)=>img._rect = null);
// use global position to calculate if an img is in the viewable area
updateImgs(this._content._imgs, this._content._cTop * -1, this._content.contentHeight, this._content.directionY, 1400, 400);
}
};
}
}
}
DavidWiesner ๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค
๋๋ ์ด์จ ๋ฐ ๊ฐ๋๊ฐ ์ฒ์์
๋๋ค (์ด์จ ํ
์คํธ ๋ ์ค์ ๋ก ๋ค์ดํฐ๋ธ ๋ฐ์ ํ
์คํธ)
์ด๋ค ํ์ผ์์ ์ด๊ฒ์ ์ง๋์ณ์ผ ํฉ๋๊น? app.components.ts์์?
@DavidWiesner , ์๋ฃจ์ ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ์๋ฅผ ๋ค์ด ์ฃผ์๊ฒ ์ต๋๊น? ๋๋ updateImgs() ํจ์์ ๋ถ์ด์๋ค
@alainib
src/app/app.module.ts์ ๋ฑ๋กํด์ผ ํ๋ ๊ฒ๋ณด๋ค src/components/virtual-ion-img.ts์ ๊ฐ์ ์ ํ์ผ์ ์์ฑํด์ผ ํฉ๋๋ค.
import {VirtualIonImg} from "../components/virtual-ion-img";
...
@NgModule({
declarations: [
//... all other pages and components,
VirtualIonImg
],
//... all other stuff e.g.: imports, providers
entryComponents: [
//... other pages and components,
VirtualIonImg
]
})
http://ionicframework.com/docs/api/components/virtual-scroll/VirtualScroll/#images -within-virtual์ ์ค๋ช
๋ ๋๋ก <ion-img>
๋์ <virtual-ion-img [src]="url"></virtual-ion-img>
ํ๊ทธ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. -์คํฌ๋กค
๋ด๋ถ์ ๊ฐ์ ์คํฌ๋กค์ด ์๋ typescript ํ์ด์ง ํ์ผ์ ํธ์งํ๊ณ ๊ฐ์ ธ์ค๊ธฐ, ViewChild
ํญ๋ชฉ ๋ฐ ngAfterViewInit
๋ฉ์๋๋ฅผ ์ถ๊ฐํ๊ธฐ๋ง ํ๋ฉด ๋ฉ๋๋ค.
@kabus202 ๋๊ธ์ ์์ ํ๊ณ ๋๋ฝ๋ import ๋ฌธ์ ์ถ๊ฐํ์ต๋๋ค. updateImgs
ํจ์๋ ionic angular ์ฝํ
์ธ ํจํค์ง์ ์ ์๋์ด ์์ผ๋ฉฐ ๊ฐ์ ธ์์ผ ํฉ๋๋ค.
@DavidWiesner ์ฒซ ๋ฒ์งธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ๋ ์ ์๋ํ์ง๋ง ์ฌ์ ํ ๋ก๋๋์ง ์๋ ์ด๋ฏธ์ง ๋์ ์ค๋๋ ์ด๋ฏธ์ง๊ฐ ํ์๋ฉ๋๋ค.
@DavidWiesner : ์ ๋ง ๊ฐ์ฌํฉ๋๋ค! ๊ทํ์ ์ฒซ ๋ฒ์งธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ ์๊ฒ ์๋ฒฝํ๊ฒ ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค(์ ๊ฐ ๋ฏธ์น ๊ฒ์ด ์๋๋ผ VirtualScroll์ด ์ค์ ๋ก ๊ณ ์ฅ๋ฌ๋ค๋ ๊ฒ์ ํ์ ์ํค๊ธฐ ์ํด ์์ฑํ ๋งค์ฐ ๊ฐ๋จํ ์์์). ์ด์ ์ค์ ์ฑ์์ ์๋ํด ๋ณด๊ฒ ์ต๋๋ค.
์ค์ Ionic _Img_ ๊ตฌ์ฑ ์์๋ฅผ ์์ ํ๊ธฐ ์ํด pull ์์ฒญ์ ํ ์ ์์ต๋๊น?
@DavidWiesner ์ค๋ช
๊ฐ์ฌํฉ๋๋ค.
๋๋ ์ฌ์ ํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค (์ ๋ ์ฒ์์ด๊ณ ๋์์ react/ionic/nativscript๋ฅผ ์๋ํ๊ณ ์์ต๋๋ค)
์ด๊ฒ์ด ์ ๊ฐํ๋ ๊ฒ์ ๋๋ค :
app.module.ts
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { HomePage } from '../pages/home/home';
import { TabsPage } from '../pages/tabs/tabs';
import {VirtualIonImg} from "../components/virtual-ion-img";
@NgModule({
declarations: [
MyApp, AboutPage, ContactPage, HomePage, TabsPage
VirtualIonImg
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp, AboutPage, ContactPage, HomePage,TabsPage
VirtualIonImg
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class AppModule {}
๊ฐ์ ์ด์จ img.ts
import {Component, ElementRef, Renderer, Optional} from "@angular/core";
import {Img, Platform, DomController, Content} from "ionic-angular";
@Component({
selector: 'virtual-ion-img',
template: '<img>'
})
export class VirtualIonImg extends Img {
constructor(private __elementRef: ElementRef,
__renderer: Renderer,
__plt: Platform,
@Optional() private __content: Content,
__dom: DomController) {
super(__elementRef, __renderer, __plt, __content, __dom);
}
get top(){
this._rect = (<HTMLElement>this.__elementRef.nativeElement).getBoundingClientRect();
return this._rect.top + this.__content.scrollTop - this.__content._cTop;
}
get bottom(){
this._rect = (<HTMLElement>this.__elementRef.nativeElement).getBoundingClientRect();
return this._rect.bottom + this.__content.scrollTop - this.__content._cTop;
}
}
๋ด ๊ฒฌํด
<ion-content padding>
<h2>Ionic List items</h2>
<ion-list [virtualScroll]="items">
<ion-item *virtualItem="let item">
{{ item.i }}
<virtual-ion-img [src]="item.src"
alt="item.image" height="200" width="300" >
</virtual-ion-img>
</ion-item>
</ion-list>
FIN
</ion-content>
๋๋์ด ์ค๋ฅ๊ฐ ์์ต๋๋ค :
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
date.
Error: Template parse errors:
Can't bind to 'src' since it isn't a known property of 'virtual-ion-img'.
1. If 'virtual-ion-img' is an Angular component and it has 'src' input, then verify that it is part of this module.
2. If 'virtual-ion-img' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this componen
t to suppress this message.
("
{{ item.i }}
<virtual-ion-img [ERROR ->][src]="item.src"
alt="item.image" height="200" width="300" >
</virtual-ion-img>
"): HomePage<strong i="19">@16</strong>:25
๋ด๊ฐ ๋ฌด์์ ๋์น๊ณ ์์ต๋๊น?
@alainib src="item.src
[src]="item.src"
๋ฅผ ์ฌ์ฉํด์ผ ํ ์๋ ์์ต๋๋ค.
์นด๋ฒ์ค202 . ๋์ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ๋ด๊ฐ ์ป๋ ์ค๋ฅ๋ [src]์ ๋๋ค. ๋ ๋ค ์๋ํ์ง๋ง ์๋ชป๋ html ์ฝ๋๋ฅผ ๋ถ์ฌ ๋ฃ์์ต๋๋ค.)
'rc'๋ฅผ ์ฌ์ฉํ๋ฉด์ด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
typescript: ..._amap/react-native-compare-ionic2-master/ionic/src/components/virtual-ion-img.ts, line: 14
Supplied parameters do not match any signature of call target.
__dom: DomController) {
super(__elementRef, __renderer, __plt, __content, __dom);
ngc failed: Failed to transpile TypeScript
@alainib ์ด๋ค ๋ฒ์ ์ ionic์ ์ฌ์ฉํ์ญ๋๊น? 3.2์์ Img
์ ์์ฑ์๊ฐ ๋ณ๊ฒฝ๋์์ต๋๋ค. Ionic 3.2 ์ด์ ์๋ ์์ฑ์์ ๋ค๋ฅธ ๋งค๊ฐ๋ณ์๋ก NgZone์ ์ถ๊ฐํด์ผ ํ์ต๋๋ค.
VirtualIonImg
์ด์ Ionic 3.2import {Component, ElementRef, Renderer, Optional, NgZone} from "@angular/core";
import {Img, Platform, DomController, Content} from "ionic-angular";
@Component({
selector: 'virtual-ion-img',
template: '<img>'
})
export class VirtualIonImg extends Img {
constructor(private __elementRef: ElementRef,
__renderer: Renderer,
__plt: Platform,
__zone: NgZone,
@Optional() private __content: Content,
__dom: DomController) {
super(__elementRef, __renderer, __plt, __zone, __content, __dom);
}
get top(){
this._rect = (<HTMLElement>this.__elementRef.nativeElement).getBoundingClientRect();
return this._rect.top + this.__content.scrollTop - this.__content._cTop;
}
get bottom(){
this._rect = (<HTMLElement>this.__elementRef.nativeElement).getBoundingClientRect();
return this._rect.bottom + this.__content.scrollTop - this.__content._cTop;
}
}
6๊ฐ์์ด ์ง๋ฌ๋๋ฐ ์ ์ ๊ณ ์ณ์ก์ง?
@WangRongda ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ์น์ธ๋์ด์ผ ํ๋ PR์ ์ ์ถํ์ จ์ต๋๊น?
@janpio ๋ง๋ฒ์ฒ๋ผ ์ง๊ธ์ ์ ์์ ์ผ๋ก ํ์๋ฉ๋๋ค. ion-img๊ฐ ์ ์์ ์ผ๋ก ํ์๋์ง ์์ ๋ฉฐ์น ๊ณ ์ํ์ต๋๋ค.์ฃ์กํฉ๋๋ค.
์๊ฒฉ ์ด๋ฏธ์ง๊ฐ ์๋ ~200๊ฐ ํญ๋ชฉ์ด ์๋ ๋ชฉ๋ก์์ ์ด๋ฏธ์ง๊ฐ ๋ก๋๋์ง ์๊ฑฐ๋ ์คํฌ๋จ๋ธ๋ฉ๋๋ค(์ด์ ํญ๋ชฉ์ ์ด๋ฏธ์ง๊ฐ ํ์ฌ ํญ๋ชฉ์ ์์). ์ฌ์ ํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์์ด๋์ด๊ฐ ์์ต๋๊น? virtual-ion-img๋ก ์๋ฃจ์ ์ ์๋ํ์ง๋ง ์๋ํ์ง ์์์ต๋๋ค.
@dspachos ๋ ionic ํ์ด ๊ฐ์ ์คํฌ๋กค ๋ฒ๊ทธ๋ฅผ ์์ ํ๋ ๊ฒ์ด ํ์ฌ ์ฐ์ ์์๊ฐ ์๋๋ผ ๋ฌดํ ์คํฌ๋กค์ ๋์ ์ฌ์ฉํ๋ค๊ณ ์ธ๊ธํ ๊ฒ์ ์ดํดํฉ๋๋ค.
@JustasKuizinas ๊ทธ๋ฌ๋ infinite-scroll
๋ ํด๊ฒฐ์ฑ
์ด ์๋๋๋ค. ๊ฒฐ๊ตญ ๋ชจ๋ ํญ๋ชฉ์ DOM์ ์์ต๋๋ค. ๊ทธ๋์ ํนํ iOS์์ ๋ง์ ๋ฉ๋ชจ๋ฆฌ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
ionic1.x์์๋ ๋น์ทํ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค. ๋๋ ๊ทธ๋ค ๋ชจ๋๊ฐ ionic2 ๋๋ 3์ ๊ณ ์ ๋์ด ์๋ค๊ณ ์๊ฐํ์ต๋๋ค. ๋ถํํ๋ ํด๊ฒฐ์ฑ ์ด ์์ต๋๋ค.
@vahidvdn ์๋ฃจ์ ์ ์๋์ง๋ง ionic ํ ์์ฒด๊ฐ ๊ฐ์ ์คํฌ๋กค์ด ์์ ๋ ๋๊น์ง ์ง๊ธ ๋น์ฅ์ ์ต์ ์ ์ ํ์ด๋ผ๊ณ ๋งํ์ต๋๋ค. :)
@JustasKuizinas ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
๊ทธ๋ฌ๋ vs-repeat
(angularjs ๋ฐ angular ๋ชจ๋์ ๋ํด)๋ผ๋ ์ข์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์์ต๋๋ค. angularjs๋ฅผ ํ
์คํธํ์ต๋๋ค. ์ ๋ง ๊ต์ฅํ์ง๋ง iOS์์ ์คํฌ๋กคํ๋ ๋์ ๋ง์ ์ง์ฐ์ด ์์ต๋๋ค.
ionic ํ์ ์ฐ์ ์์๊ฐ ๋ฌด์์ธ์ง ๋ชจ๋ฅด๊ฒ ์ง๋ง virtualScroll์ ์ค์ ์ฑ์์ ์ฌ์ฉํ๋ ๊ฐ์ฅ ์ค์ํ ๊ตฌ์ฑ ์์ ์ค ํ๋์ ๋๋ค.
@vahidvdn ์ ์ ์ผ๋ก ๋์ํฉ๋๋ค. ํ์ฌ ์ฑ์ Ionic์ ์ฌ์ฉํ์ฌ ์์ฑํ์ง๋ง ๋ค์ ์ฑ์์๋ ๋ค๋ฅธ ํ๋ ์์ํฌ(React Native ๋๋ Native ์คํฌ๋ฆฝํธ)๋ฅผ ์ฌ์ฉํ๊ธฐ๋ก ๊ฒฐ์ ํ์ต๋๋ค. Ionic ํ์ ํ๋ฅญํ ์ผ์ ํ๊ณ ์์ง๋ง ํ๋ ์์ํฌ์ ์ฑ๋ฅ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ํ์ฌ ์ฑ์์ ์ด๋ฏธ์ง๊ฐ ํฌํจ๋ ์ต๋ 50๊ฐ ํญ๋ชฉ์ ์ ์ ๋ชฉ๋ก(๊ฐ์ ์คํฌ๋กค ๋ฒ๊ทธ๋ก ์ธํด)์ผ๋ก ๋๋ฌ๊ณ ๋ค๋ก ๋ฒํผ์ ๋๋ฅด๋ฉด ์ง์ฐ์ด ๋ฐ์ํฉ๋๋ค(๊ธฐ๋ณธ ๋์์ธ popView๋ฅผ ์ฌ์ฉํฉ๋๋ค). ๋ด ๋ชฉ๋ก์ 15-20๊ฐ์ ํญ๋ชฉ์ด ์๋ ๊ฒฝ์ฐ์ ๊ฐ์ด ์ด ์ง์ฐ์ ์กด์ฌํ์ง ์์ต๋๋ค.
๋์ฑ์ด iOS์์๋ ๊ธฐ๊ธฐ๊ฐ ๋ฐฐํฐ๋ฆฌ ์ ์ฝ ๋ชจ๋์ ์์ ๋(๊ทธ๋ฆฌ๊ณ CPU๊ฐ ์๋ง๋ ์๋๋ฅผ ๋ฆ์ถ๊ณ ์์ ๋) ์ฑ๋ฅ์ด ํจ์ฌ ๋ ๋๋น ์ ธ ๊ฑฐ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
@dspachos ๋ช ๋ฌ ์ ์๋ ์ค ๊ฐ์ ์คํฌ๋กค์ด๋ผ๊ณ ์๊ฐํ์ฌ ๋งค๋ ฅ์ฒ๋ผ ์๋ํ๋๋ก ํ๋ ๊ฒ์ด ์ต์ฐ์ ์ด์ด์ผ ํ๋ฏ๋ก ๋ค์ดํฐ๋ธ ์คํฌ๋ฆฝํธ ๋์ ionic์ ์ ํํ์ง๋ง ์ง๊ธ์ ์ฌ์ ํ โโ์์๋๊ณ ์ง์ฐ ์๋ ์ฑ๋ฅ์ ์ป์ ์ ์๋ค๋ ์์์ ๋ฃ๊ฒ ๋์ด ์ฌํ๋๋ค. ๋ฐฉ๋ํ ๋ฐ์ดํฐ ๋ชฉ๋ก.
์ ๋ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์์ง๋ง ๋ด ๋ชฉ๋ก์ 150๊ฐ ๋ฏธ๋ง์ ํญ๋ชฉ์ด ์๋ค๋ ๊ฒ์ ์๊ณ ์์ต๋๋ค. ion-img
img
๋ฅผ ์ฌ์ฉํ๋ ค๊ณ ํ๊ณ ์ฑ๋ฅ ์์ค ์์ด ์ ์๋ํฉ๋๋ค. ion-img
๋ก ํด๊ฒฐํ๋ ๋ฐ ์๊ฐ์ ์์์ง๋ง ์ค์ ๋ก ๋ชจ๋ ๋ชฉ๋ก์ ์ด ๋ฆฌ์์ค๊ฐ ํ์ํ ๊ฒ์ ์๋๋๋ค.
@diegomachado1 ์ด๋ฏธ์ง๊ฐ ์ฌ๋ฐ๋ฅธ ์์น์ ์์ต๋๊น? ๋คํธ์ํฌ ์ฐ๊ฒฐ ์๋๋ฅผ ๋ฎ์ถ๊ณ ๋ค์ ํ ์คํธํ์ญ์์ค. ์ผ๋ถ ์ด๋ฏธ์ง๊ฐ ๋ก๋๋์ง ์์ผ๋ฉด ์ด์ ์ด๋ฏธ์ง๊ฐ ์ ์๋ฆฌ์ ์์ ์๋ก ์ถฉ๋ํฉ๋๋ค.
2017-08-16 ๋ฐ ionic 3.6 ๋ฐ ๋ฌธ์ ๊ฐ ์ฌ์ ํ ์กด์ฌํฉ๋๋ค.
์ ๊ฒฝ์ฐ์๋ ๋ ๋ฒ์งธ ์์ ์ฌํญ(์๋จ์ ๊ฒ์๋จ)์ ์ ์ฉํ๊ณ ์๋ํฉ๋๋ค.
@decpio ์ ํํ ๋ฌด์์ ํ๋์ง ์๋ ค์ฃผ์๊ฒ ์ต๋๊น?
ํ์ธ,
๊นจ์ง ํ์ด์ง์ ๋ค์์ ์ถ๊ฐํ์ต๋๋ค.
'@angular/core'์์ { Component, ViewChild } ๊ฐ์ ธ์ค๊ธฐ;
'ionic-angular/components/content/content'์์ { updateImgs } ๊ฐ์ ธ์ค๊ธฐ;
'ionic-angular/components/img/img-interface'์์ { Img } ๊ฐ์ ธ์ค๊ธฐ;
'ionic-angular'์์ { ์ฝํ
์ธ } ๊ฐ์ ธ์ค๊ธฐ;
/* 2017-08-16 - add this to class body
start FIX#9660 ion-img doesn't correctly work with virtualScroll
https://github.com/ionic-team/ionic/issues/9660#issuecomment-304840427
*/
@ViewChild(Content) _content: Content;
ngAfterViewInit() {
if (this._content) {
this._content.imgsUpdate = () => {
if (this._content._scroll.initialized && this._content._imgs.length && this._content.isImgsUpdatable()) {
// reset cached bounds
this._content._imgs.forEach((img: Img) => (<any>img)._rect = null);
// use global position to calculate if an img is in the viewable area
updateImgs(this._content._imgs, this._content._cTop * -1, this._content.contentHeight, this._content.directionY, 1400, 400);
}
};
}
}
/*
end FIX#9660
*/
๊ทธ๊ฒ ๋ค์ผ - ๋ฌธ์ ๊ฐ ์ฌ๋ผ์ง๋๋ค.
๋ด ๊นจ์ง ํ์ด์ง:
<ion-content padding>
<ion-grid [virtualScroll]="__items" [bufferRatio]="2" approxItemHeight="80px" approxItemWidth="100%" [virtualTrackBy]="ItemComparer">
<div *virtualItem="let item">
<ion-row align-items-center justify-content-center>
<ion-col col-auto>
<ion-item>
<ion-thumbnail item-start>
<ion-img [src]="'my-personalized-url?item='+item?.item"></ion-img>
</ion-thumbnail>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
@DavidWiesner ๊ฐ์ฌํฉ๋๋ค! ์ ๋ Ionic-Angular 3.6.0(์ด ๊ธ์ ์ฐ๋ ์์ ์์ ์ต์ ๋ฒ์ )์ ์ฌ์ฉํ๊ณ ์์ผ๋ฉฐ ์์๋๋ก ์๋ํฉ๋๋ค.
2๋ฒ๋ ์์ฃผ ์์ฐ๊ณ ์์ต๋๋ค. ํ์ง๋ง ๋๋น์ ๋์ด ๋ฌธ์ ๋๋ฌธ์ ์ฌ์ฉํ๊ณ ์ถ์ง ์์์ต๋๋ค. ๋ํ ์ด๋ฏธ์ง๊ฐ ๋ก๋๋์ง ์์ ๊ฒฝ์ฐ ๋งจ ์๋ ํญ๋ชฉ์ด ์ ํญ๋ชฉ๊ณผ ๊ฒน์น๋ ๋ช ๊ฐ์ง ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. ๊ทธ๋ฌ๋ ์๋๋ก ์คํฌ๋กคํ๋ฉด ๊ฒน์น๋ ๋ฌธ์ ๊ฐ ์ฌ๋ผ์ง๋๋ค. ๋ทฐํฌํธ์์ ์ฌ๋ผ์ง ์ด์ ํญ๋ชฉ์ด ๊ฒน์น๊ธฐ ์์ํ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ํด๋น ํญ๋ชฉ์ด ๋ทฐํฌํธ์ ์๊ณ ์ด๋ฏธ์ง๊ฐ ๋ค์ ๋ก๋๋๋ฉด ํด๋น ๋ฐฐ์น์์ ๊ฒน์น๋ ๋ฌธ์ ๊ฐ ์ฌ๋ผ์ง๋๋ค. ์ฐธ๊ณ ๋ก.
@decpio ๊ทํ์ ์๋ฃจ์ ์ ์ ์๊ฒ ์๋ฒฝํ๊ฒ ์๋ํฉ๋๋ค. ์คํฌ๋กค์ด ๋๋ฌํ์ง ์๋ ํ ์ด๋ฏธ์ง๋ "์ธ๋ก๋" ์ํ๋ก ์ ์ง๋์ง๋ง ๋ก๋๋์ด์ผ ํ ๋ ๋ก๋๋๊ณ ๋ํ๋ฉ๋๋ค. ๋งค์ฐ ๊ฐ์ฌํฉ๋๋ค!!!
ํ ๊ฐ์ง ์ฃผ์ํ ์ ์ ํ์ด์ง๊ฐ ๋ก๋๋ ํ ํ๋ฉด/์ฐฝ/ํ๋ ์ ํฌ๊ธฐ๊ฐ ๋ณ๊ฒฝ๋๋ ๊ฒฝ์ฐ init ๋ฒ์ ๋ด์ ์๋ ํญ๋ชฉ ์์ ๋ํด์๋ง ๋ ์ด์ค ๋ก๋๊ฐ ๊ณ์ ์๋ํ๋ค๋ ๊ฒ์ ๋๋ค. ๊ทธ๋ฌ๋ ์ด๊ฒ์ ์ด๋ฏธ ์์ ๋์์ผ๋ก ์ธํด ๋ฐ์ํ ์ ์์ต๋๋ค.
๊ฐ์ฌ ํฉ๋๋ค @DavidWiesner & @decpio ๋ ๋ฒ์งธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ Ionic 3.7.1์์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํฉ๋๋ค.
๋ฐ๋ผ์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ Ionic 3.8์ ๋ฌธ์ ๋ ํด๊ฒฐํฉ๋๋ค. @manucorporat @adamdbradley๋ฅผ ์ฌ์ฉํ์ง ์๋ ์ด์
์ด๊ฒ์ ์ฌ์ ํ โโ๋ชจ๋ VS ์ฌ์ฉ์ ์ ๋ง ๋์ ๊ฒ์
๋๋ค ...
@masimplo ํ์ธํด๋ณด์ค๋์? https://github.com/ionic-team/ionic/pull/12917 ์ ๋ํ ๋ฉ์ง ์์
์ ๋ง์น ํ VS์ ๋ฐ์ด๋ค ์ ์๋ ๊ธฐ์ ์ด ํ์คํ ์๊ฒผ์ต๋๋ค... ๐
์ด ํด๊ฒฐ ๋ฐฉ๋ฒ์ iOS9์์ ์๋ํ์ง ์์ต๋๋ค. iOS10 ๋ฐ iOS11์์๋ ๊ด์ฐฎ์ต๋๋ค.
@HugoHeneault , @manucorporat , @adamdbradley : ์ด ํด๊ฒฐ ๋ฐฉ๋ฒ์ Ionic์ ๋ณํฉํด์ผ ํ๋ค๋ ๋ฐ ์ ์ ์ผ๋ก ๋์ํฉ๋๋ค(ํ ๋ฆฌํ์คํธ๋ฅผ ์ํํ์ง๋ง ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์์ฑ์๊ฐ ์๋๊ธฐ ๋๋ฌธ์ ์ง์ ๋ง๋๋ ๊ฒ์ด ๋ถํธํจ). ์๋ฒฝํ์ง๋ ์์ง๋ง ํจ์น๊ฐ ์๋ ๊ฒ๋ณด๋ค ํจ์ฌ ๋ซ์ต๋๋ค.
๋ฌธ์ ๋ Ionic ํ์ด virtualscroll์ด ์๋ํ์ง ์๋๋ค๋ ๊ฒ์ ๊นจ๋ซ์ง ๋ชปํ๋ค๋ ๊ฒ์ ๋๋ค. 3.8 ๋ณ๊ฒฝ ๋ก๊ทธ์ "๊ฐ์ ์คํฌ๋กค: ๊น๋ฐ์ ๋ฌธ์ ์์ "์ด๋ผ๋ ํญ๋ชฉ์ด ์์ต๋๋ค. ์ ํ ์๋ํ์ง ์๋ ๊ธฐ๋ฅ์ ๋ํด ๊น๋ฐ์ด๋ ๋ฌธ์ ๋ฅผ ์์ ํ๋ ์ด์ ๋ ๋ฌด์์ ๋๊น?
@nicolus Ionic ํ์ด virtualscroll/ion-img๊ฐ ์๋ํ์ง ์๊ณ virtualscroll์ด ion-refresh์ ํจ๊ป ์๋ํ์ง ์๋๋ค๋ ๊ฒ์ ๊นจ๋ซ์ง ๋ชปํ๋ค๋ ๋ฐ ๋์ํฉ๋๋ค. @Apink_2020 @sun_sssssssss @_aaaaaaaaaaa
@HugoHeneault ์ ๋ ion-img๋ก ์ ํ ์์ ํ์ง ์์์ต๋๋ค. ๊ทธ๋ฌ์ด์ผ ํ๋๋ฐ ์ ํ์ด. ๋ณผ ์๋ ์์ง๋ง ๊ณ ์ฅ๋ ๊ฒ์ ๋ํ ์ฐธ์กฐ๊ฐ ์์ต๋๋ค.
๋ณ๊ฒฝ ๋ก๊ทธ์ @nicolus ํญ๋ชฉ์ ๊ฐ์ ์คํฌ๋กค์ ํ๊ท ๋ฌธ์ ๋ฅผ ์์ ํ๊ธฐ ์ํด ์ง์ ์ ์ถํ PR์์ ๊ฐ์ ธ์จ ๊ฒ์ ๋๋ค. ๋๋ ๋น์ ์ ์ข์ ์ ์ดํดํ์ง๋ง, ๊ทธ PR์ ๊ธฐ๋ณธ ๋ฐ์ดํฐ ์ธํธ๊ฐ ์์ฃผ ์ ๋ฐ์ดํธ๋ ๋ ์ฌ์ฉํ ์ ์๊ฒ ๋ง๋๋ VS์ ํน์ ๋ฌธ์ ๋ฅผ ์์ ํ์ผ๋ฉฐ ๋ชจ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ๊ตฌ์ฑ ์์์ ์์ ํ ์ฌ์์ฑ์ ์๋์์ต๋๋ค.
๋๋ VS๊ฐ ํจ์ฌ ๋ ๋ง์ ๊ด์ฌ์ ํ์๋ก ํ๋ค๋ ๋ฐ ๋์ํ์ง๋ง ์ ์ง ๊ด๋ฆฌ๋ฅผ ๋ถ๊ฐ๋ฅํ๊ฒ ๋ง๋๋ ๋ ๊ฐ์ง ์ฃผ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
์ด ๋ณต์ก์ฑ์ PR์ด ์ฒ๋ฆฌํ๊ธฐ์๋ ๋๋ฌด ์ปค์ ๊ฐ์ ์คํฌ๋กค์ด ์ํํ๋ ์์ (์ด๋ ์ด์จ ํ์ ๋ชฉํ์ ์ผ์นํด์ผ ํจ์ ์๋ฏธํจ), ์ํ ๋ฐฉ๋ฒ ๋ฐ ๋ค๋ฅธ ๊ตฌ์ฑ ์์์์ ์ํธ ์์ฉ์ ๋ํ ์์ ํ ์ฌ์ค๊ณ๊ฐ ํ์ํฉ๋๋ค.
ionic v4๋ก ์ด๋ํ๋ฉด ํด๋ฆฌ๋จธ์ ์ฒ ๋ชฉ๋ก์ด ์ค๋๋ ๊ณผ ๊ฐ์ด ๋ณ๊ฒฝ๋ ๊ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค. ํ์ฌ ๊ตฌํ์ ํ๋ก์ ํธ์์ v4 ๋ฆด๋ฆฌ์ค ์ดํ ionic ํ๋ ์์ํฌ๋ฅผ ๊ณ์ ์ฌ์ฉํ ์ฌ๋๋ค์๊ฒ ์ค์ง์ ์ธ ๊ฐ์น๊ฐ ์์ต๋๋ค. ์ ์ญ์ ๊ฐ์ ์คํฌ๋กค ์์ด๋ ์ค์ ์์ ๋ฐ์ดํฐ๋ฅผ ๋ ๋๋งํ๋ ๋ฐ ์์ด ๊ธฐ๋ณธ ์ ํ๋ฆฌ์ผ์ด์
๊ณผ ๊ฒฝ์ํ ์ ์๊ธฐ ๋๋ฌธ์ ์ด ํ ๋ผ ๊ตฌ๋ฉ์์ ๋ฒ์ด๋๋ ์ต์
์ ์ฐพ๊ณ ์์ต๋๋ค.
@masimplo : ๋ง์ต๋๋ค. ๊ฐ์ ์คํฌ๋กค์ด ion-img ์ด์์ ์ฉ๋๋ก ์ฌ์ฉ๋๋ค๋ ์ฌ์ค์ ์์์ต๋๋ค(๊ฐ์ธ์ ์ผ๋ก ์ฌ์ฉํ๋ ์ฉ๋์ด๊ธฐ ๋๋ฌธ์
๋๋ค).
์ด ํน์ ๋ฒ๊ทธ ์์ ์ ๋นํํ๋ ค๋ ๊ฒ์ ์๋๋๋ค. ์ด ๋ฌธ์ ์ ๊ด๋ จํ์ฌ ํ์์ ๋ ๋ง์ ํผ๋๋ฐฑ์ ๋ฐ์์ผ๋ฉด ํฉ๋๋ค.
์ด ๋ฌธ์ ์ ๋ํ ๋น ๋ฅธ ์์ ์ ๋ฐ๋๋๋ค. ์์์ด ์๋์? ์ด๊ฑฐ ํ์์ ์กฐ์ฌํ๋์?
๋๋ ์์ ๋ฐ๋๋๋ค
@RafaelKr @fdambrosio v4๊ฐ ์ถ์๋๊ธฐ ์ ์ ๊ตฌ์ฑ ์์์ ๋ํ ์์ ์ ๊ธฐ๋ํ์ง ์๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋ถํํ๊ฒ๋ ionic3๋ก ์์ ํ๋ ์ฐ๋ฆฌ์๊ฒ๋ ๋ฒ๊ทธ๊ฐ ์๋ ๊ตฌ์ฑ ์์๋ฅผ ์ฒ๋ฆฌํ๊ฑฐ๋ ์ค์ค๋ก ์์ ํด์ผ ํฉ๋๋ค. ์์ ๋กญ๊ฒ ์์ ํ๊ณ PR์ ์์ฑํ์ธ์ ;)
+1
์ด ๋ฐฉ๋ฒ์ ์ฌ์ฉํด๋ณด์ญ์์ค
html
<ion-img [src]="image.url" [alt]="image.alt">
์ฌ์ ํ ์์ ์ ๊ธฐ๋ค๋ฆฌ๊ณ ์์ต๋๋ค ...
ionic v4๋ฅผ ๊ธฐ๋ค๋ ค์ผ ํฉ๋๋ค.
@miqmago : ์ถ๊ฐ ์ ๋ณด๋ ์ฌ๊ธฐ๋ฅผ ์ฝ์ด์ฃผ์ธ์:
https://blog.ionicframework.com/whats-the-issue-with-issues/
https://github.com/ionic-team/ionic/issues/9660#issuecomment -307314053 ์๋ํ์ต๋๋ค
์ด๋ฏธ์ง๋ฅผ ํ์ํ๋ ๊ฒ๊ณผ ๋์ผํ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค.
ionic v4๋ฅผ ๊ธฐ๋ค๋ ค์ผ ํฉ๋๋ค.
Ionic 4์์ ์์ ๋ ๊ฒ์ด๋ผ๊ณ ๋ฏฟ๋ ๊ฒ์ ์ด๋ฆฌ์์ ์ผ์
๋๋ค.
์๋ก์ด ๋ฒ๊ทธ๊ฐ ์์ง๋ง ํ์ Ionic 5, 6์ ์ค์ ์ ๋๊ณ ๊ฐ๊ฐ์ ์ ๋ฒ์ ์ ๋ํด ๋ง์ ๋ฒ๊ทธ๋ฅผ ๋จ๊น๋๋ค.
React ์ธก๋ฉด์์ ๊ฐ ๋ฒ์ ์์ ๋ณ๊ฒฝ ์ฌํญ์ ๊นจ๋จ๋ฆด ์ํ์ด ์์ง๋ง ์ ์ด๋ ์ฐ๋ฆฌ๋ ๋ฌด์์ ๊ธฐ๋ํด์ผ ํ๋์ง ์๊ณ ์์ต๋๋ค.
Ionic์ ๋งค์ฐ ์ค๋งํ์ต๋๋ค... ๋ฒ๊ทธ๋ฅผ ๋๋ฌด ์ค๋ ๋๊ณ ์ฌ์ฉ์๊ฐ ์์ ํ๋๋ก ๋๋๋ ๊ฒ์ ๊ฐ์น๊ฐ ์์ต๋๋ค.
@mopi1402 ๊ณผ๊ฑฐ์ ionic ํ์์ ๋ฌธ์ ๋ฅผ ์ฒ๋ฆฌํ ๋ฐฉ์์ด ์ข์ง ์๋ค๋ ๊ฒ์ ์๊ณ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ฒ์ ๊ด๋ฆฌ ๋ฐ ํฅํ ๋ฌธ์ ๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ์๊ณ ์ถ๋ค๋ฉด ๋ค์์ ์ฝ์ด์ผ ํฉ๋๋ค.
https://blog.ionicframework.com/whats-the-issue-with-issues/
https://blog.ionicframework.com/ionic-semantic-versioning-release-schedule-and-lts/
ionic ํ๋ ์์ํฌ๋ ์คํ ์์ค์ด๋ฉฐ ๋๊ตฌ๋ ๋ฌธ์ ํด๊ฒฐ์ ๋์ธ ์ ์๋ค๋ ๊ฒ์ ์์ง ๋ง์ญ์์ค. :)
@mopi1402 Angular ๊ฐ๋ฐ์๋ผ๋ฉด react-native ๋์ Nativescript๋ฅผ ์ถ์ฒํฉ๋๋ค.
์ฌ๊ธฐ์์ ๋ค์ดํฐ๋ธ์คํฌ๋ฆฝํธ๊ฐ ๋ฐ์๋ณด๋ค ๋์ ์ด์ ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.
@mopi1402 ์ ๋์ํฉ๋๋ค. ์ด๊ฒ์ด ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉ๋๋ ๊ธฐ๋ฅ ์ค ํ๋์ ๋๋ค.
์์ง v4 ๋ฒ ํ์์ ์๋ํ์ง ์์ต๋๋ค.
Ionic 4์์ ์๋ํ์ง ์๋ ๊ฒ์ ์ข์ง ์์ต๋๋ค.
Ionic์ ์คํ ์์ค ์ํํธ์จ์ด์ ๋๋ค. ๋นจ๋ฆฌ ์์ ํ๊ณ ์ถ๋ค๋ฉด ํจ์น๋ฅผ ๋ง๋ค๊ณ PR์ ์ ์ถํ์ธ์ ๐
@HugoHeneault : ๋ด ํ๋ก ๊ตฌ๋ ์ ํตํด ํ ๋ฌ์ 29๋ฌ๋ฌ๋ฅผ ์ง๋ถํ๋ ์คํ ์์ค ์ํํธ์จ์ด์ ๋๋ค(ํ๋ ์์ํฌ ์์ฒด๋ ๋ฌด๋ฃ์ง๋ง ๋น์๋ฆฌ ์กฐ์ง์ด ์๋๋ผ ๊ตฌ๋ ๋ฃ), ๊ทธ๋์ ๋๋ ๋ฌด๋ฃ๋ก ๊ทธ๊ฒ์ ์ค์ค๋ก ๊ณ ์น ํ์๊ฐ ์์ ๊ฒ์ผ๋ก ๊ธฐ๋ํฉ๋๋ค.
์์ ํ๊ธฐ ์ด๋ ค์ด ๋ฌธ์ ์ด๊ณ ionic 4๊ฐ ์์ง ๋ฒ ํ ๋ฒ์ ์ด๋ฉฐ ์ฐ์ ์์๊ฐ ๋ฎ์ ๋ฌธ์ ๋ผ๋ ๊ฒ์ ์ดํดํ ์ ์์ต๋๋ค... ์ด ๋ชจ๋ ๊ฒ์ด ์๋ฒฝํ๊ฒ ํ๋นํ ์ด์ ์ด์ง๋ง "OSS๊ฐ ์ค์ค๋ก ํด๊ฒฐํฉ๋๋ค lol"์ ๊ทธ๋ ์ง ์์ต๋๋ค.
@nicolus ๋น์ ๋ง์ด ์ณ์๊ณ , ๋ด๊ฐ ์ง๋ถํ ์๋น์ค๊ฐ ์๋ํ์ง ์์ ๋๋ ๋ถํํ์ต๋๋ค. ๊ทธ๋ฌ๋ ์ฐ๋ฆฌ๋ Ionic ํ์ฌ๊ฐ ํ๋ฆฌ๋ฏธ์ ์๋น์ค๋ก ๋์ ๋ฒ๊ณ ์๋ค๊ณ ํด๋ ํ์ ๋ง์ ๊ฐ๋ฐ์๊ฐ ๋ง์ ์ผ์ ํ๊ณ ์์ผ๋ฉฐ ๋๊ตฌ๋ ์ง๋ถํ์ง ์๊ณ ์ฌ์ฉํ ์ ์๋ ๋ฌด๋ฃ ๋๊ตฌ๋ฅผ ์ํด ์๊ณ๋ฅผ ๊พธ๋ ค์ผ ํ๋ค๋ ์ ์ ๋ช ์ฌํด์ผ ํฉ๋๋ค.
์ ์๊ฒ๋ OSS๊ฐ ์๋ํ๋ ๋ฐฉ์์ ๋๋ค. ์๋น์ค ๋น์ฉ์ ์ง๋ถํ ์๋ฌด๊ฐ ์์ผ๋ฉฐ ํ ํผ๋ ์ฃผ์ง ์๊ณ ๋ฉ์ง ์ฑ์ ๋ง๋ค ์ ์์ง๋ง ๊ทธ๋ค์ ๋น์ ์ ์ถ์ ๋ ์ฝ๊ฒ ๋ง๋ค์ด์ฃผ๋ ์๋น์ค๋ฅผ ์ ๊ณตํฉ๋๋ค. ๋๋ ๋ํ ๋ง์ ํ๋ก ๊ตฌ๋ ์ ๋ํด ๋น์ฉ์ ์ง๋ถํ๊ณ ์์ต๋๋ค. ๊ทธ๋ ๋ค๊ณ ๋ฉฐ์น ์ ์๋นํ์ง ์๊ณ ์์ ์ด ๊ฐ๋ฅํ ๋ ๋์์ ์ค ์ ์๋ค๋ ์๋ฏธ๋ ์๋๋๋ค.
์ด ๋ฌธ์ ๋ Ionic 3 ๋ฌธ์ ๋ก ์๋ ์๋ณ๋์์ต๋๋ค. ์ต๊ทผ์ Ionic 3๋ฅผ ์์ฒด ์ ์ฅ์๋ก ์ฎ๊ฒผ์ต๋๋ค. ์ด ๋ฌธ์ ๋ฅผ Ionic 3์ฉ ์ ์ฅ์๋ก ์ฎ๊ธฐ๊ณ ์์ต๋๋ค. ์ฌ๊ธฐ์์ ์ด ๋ฌธ์ ๋ฅผ ์ถ์ ํ์ญ์์ค.
์ ๊ฐ ์ค์๋ฅผ ํ๊ณ ์ด ๋ฌธ์ ๊ฐ ์ฌ์ ํ Ionic 4์ ๊ด๋ จ์ด ์๋ค๋ฉด Ionic Framework ํ์ ์๋ ค์ฃผ์ญ์์ค!
์์ด์ค๋์ ์ด์ฉํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!
๋ฌธ์ ์ด๋: https://github.com/ionic-team/ionic-v3/issues/148
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๋ ๋ํ์ด ๋ฌธ์ ๊ฐ ์์๋ค. ๋ฒ๊ทธ๋ ion-img์์
img::top
๋ฐimg::bottom
์ ๊ณ์ฐ์ ๋๋ค. ์ด๊ฒ์ ์คํฌ๋กคํ๋ ๋์ion-img
$์ ๋ํด $Content::updateImgs
ํ๋๊ทธcanRequest
๋ฐcanRender
๋ฅผ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.๋ด ์ฒซ ๋ฒ์งธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๊ฐ์ ๋ชฉ๋ก์ ๋ํด
ion-img
๋ฅผ ํ์ฅํ๋ ๊ฒ์ด์์ต๋๋ค.๋ ๋ค๋ฅธ ์ต์ ์ ํ์ด์ง์์ ์ด ํจ์๋ฅผ ์ฌ์ ์ํ์ฌ
Content::imgsUpdate
์ ๊ณ์ฐ์ ์์ ํ๋ ๊ฒ์ ๋๋ค.