2016-07-16 11 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) 

} 
関連する問題