2016-07-16 3 views
0

Angular2와 함께 Nativescript를 사용하기 시작했습니다. 멋진 btw입니다. 저장소 (nativescript-angular/ng-sample/app/examples/list /)의 샘플 폴더에 nativescript-angular2 List 예제를 사용했습니다. 내 홈 화면에서 데이터를 렌더링하는 구성 요소를 얻을 수 있습니다. 그러나 라우터 (v3)를 사용하여 라우팅되는 구성 요소에 List 구성 요소를 추가하면 데이터가 렌더링되지 않습니다. 그냥 비어있는 항목의 목록을 렌더링합니다.SegmentedBar 경로 후에 ListView가 렌더링되지 않습니다.

누구에게도 동일한 문제가 있습니까?

많은 감사합니다.

답변

0

예, 동일한 문제가 있습니다. 이 문제는 이미 개발자들에게 알려져 있으므로 조만간 해결 될 수 있기를 바랍니다.

그 ngzone 라우팅 가져 오십시오 해결 방법으로 (있는 변화가 관찰되지 원인) 후에 시작되지 것 같다 ...

import {ChangeDetectorRef,ApplicationRef} from '@angular/core'; 

초기화 및 사용 :

constructor(private _applicationRef: ApplicationRef,private ref:ChangeDetectorRef){ 

     setTimeout(() => { 
      _applicationRef.zone.run(() => _applicationRef.tick()) 
     }, 100)//request with timeout to start zone 

     this.ref.reattach();//reattach the change detector 
          //(i use it whenever there is a change that will change the template) 

} 
관련 문제