forked from Urigo/angular-meteor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproviders.ts
37 lines (30 loc) · 876 Bytes
/
providers.ts
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
29
30
31
32
33
34
35
36
'use strict';
import {
Provider,
ChangeDetectorRef,
IterableDiffers,
DefaultIterableDiffer,
IterableDifferFactory,
TrackByFn
} from '@angular/core';
import {MongoCursorDifferFactory} from './mongo_cursor_differ';
import {isListLikeIterable} from './utils';
export class DefaultIterableDifferFactory implements IterableDifferFactory {
constructor() {}
supports(obj: Object): boolean { return isListLikeIterable(obj); }
create(cdRef: ChangeDetectorRef, trackByFn?: TrackByFn): DefaultIterableDiffer {
return new DefaultIterableDiffer(trackByFn);
}
}
function meteorProviders() {
return [
{
provide: IterableDiffers,
useFactory: () => new IterableDiffers([
new DefaultIterableDifferFactory(),
new MongoCursorDifferFactory()
])
}
];
}
export const METEOR_PROVIDERS: Array<Provider> = meteorProviders();