@@ -7,21 +7,17 @@ import {
7
7
TemplateRef ,
8
8
ContentChild ,
9
9
EmbeddedViewRef ,
10
- HostListener ,
11
10
IterableDiffers ,
12
11
IterableDiffer ,
13
12
ChangeDetectorRef ,
14
13
EventEmitter ,
15
14
ViewChild ,
16
15
Output ,
17
- NgZone ,
18
16
ChangeDetectionStrategy } from '@angular/core' ;
19
17
import { isBlank } from '@angular/core/src/facade/lang' ;
20
18
import { isListLikeIterable } from '@angular/core/src/facade/collection' ;
21
- import { Observable as RxObservable } from 'rxjs'
22
19
import { ListView } from 'ui/list-view' ;
23
20
import { View } from 'ui/core/view' ;
24
- import { NgView } from '../view-util' ;
25
21
import { ObservableArray } from 'data/observable-array' ;
26
22
import { LayoutBase } from 'ui/layouts/layout-base' ;
27
23
import { listViewLog } from "../trace" ;
@@ -79,14 +75,12 @@ export class ListViewComponent implements DoCheck, OnDestroy {
79
75
this . _differ = this . _iterableDiffers . find ( this . _items ) . create ( this . _cdr , ( index , item ) => { return item ; } ) ;
80
76
}
81
77
82
- // this._cdr.detach();
83
78
this . listView . items = this . _items ;
84
79
}
85
80
86
81
constructor ( private _elementRef : ElementRef ,
87
82
private _iterableDiffers : IterableDiffers ,
88
- private _cdr : ChangeDetectorRef ,
89
- private _zone : NgZone ) {
83
+ private _cdr : ChangeDetectorRef ) {
90
84
this . listView = _elementRef . nativeElement ;
91
85
92
86
this . listView . on ( "itemLoading" , this . onItemLoading , this ) ;
@@ -140,15 +134,13 @@ export class ListViewComponent implements DoCheck, OnDestroy {
140
134
}
141
135
142
136
private detectChangesOnChild ( viewRef : EmbeddedViewRef < ListItemContext > , index : number ) {
143
- // Manually detect changes in view ref
144
- //
137
+ // Manually detect changes in child view ref
138
+ // TODO: Is there a better way of getting viewRef's change detector
145
139
const childChangeDetector = < ChangeDetectorRef > ( < any > viewRef ) ;
146
140
147
141
listViewLog ( "Manually detect changes in child: " + index )
148
- // listViewLog("CangeDetectionState child before mark " + getChangeDetectorState((<any>viewRef)._view));
149
142
childChangeDetector . markForCheck ( ) ;
150
143
childChangeDetector . detectChanges ( ) ;
151
- // listViewLog("CangeDetectionState child after detect " + getChangeDetectorState((<any>viewRef)._view));
152
144
}
153
145
154
146
ngDoCheck ( ) {
0 commit comments