forked from adriancarriger/angularfire2-offline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
45 lines (40 loc) · 1.34 KB
/
index.ts
File metadata and controls
45 lines (40 loc) · 1.34 KB
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
37
38
39
40
41
42
43
44
45
import {
Inject,
Injectable,
ModuleWithProviders,
NgModule,
Optional,
SkipSelf } from '@angular/core';
import { AngularFire } from 'angularfire2';
import { AngularFireOfflineDatabase } from './src/database';
import { LOCALFORAGE_PROVIDER, LocalForageToken } from './src/localforage';
import { LocalUpdateService, LOCAL_UPDATE_SERVICE_PROVIDER } from './src/local-update-service';
export { AfoListObservable } from './src/afo-list-observable';
export { AfoObjectObservable } from './src/afo-object-observable';
@Injectable()
export class AngularFireOffline {
constructor(public database: AngularFireOfflineDatabase) { }
}
export function ANGULARFIRE_OFFLINE_PROVIDER_FACTORY(parent: AngularFireOffline, AngularFire, token, LocalUpdateService) {
return parent || new AngularFireOffline( new AngularFireOfflineDatabase(AngularFire, token, LocalUpdateService ));
};
export const ANGULARFIRE_OFFLINE_PROVIDER = {
provide: AngularFireOffline,
deps: [
[new Optional(), new SkipSelf(), AngularFireOffline],
AngularFire,
[new Inject(LocalForageToken)],
LocalUpdateService
],
useFactory: ANGULARFIRE_OFFLINE_PROVIDER_FACTORY
};
@NgModule({
imports: [],
providers: [
ANGULARFIRE_OFFLINE_PROVIDER,
LOCALFORAGE_PROVIDER,
LOCAL_UPDATE_SERVICE_PROVIDER
],
declarations: []
})
export class AngularFireOfflineModule { }