Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 2d989c7

Browse files
docs(readmes): link back to master branch
1 parent dda29d9 commit 2d989c7

File tree

3 files changed

+61
-39
lines changed

3 files changed

+61
-39
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22

33
🔌 A simple wrapper for [AngularFire2](https://github.com/angular/angularfire2) to read and write to Firebase while offline, even after a complete refresh.
44

5-
[![Build Status](http://img.shields.io/travis/adriancarriger/angularfire2-offline/master.svg?maxAge=60)](https://travis-ci.org/adriancarriger/angularfire2-offline)
6-
[![Codecov](https://img.shields.io/codecov/c/github/adriancarriger/angularfire2-offline/master.svg?maxAge=60)](https://codecov.io/gh/adriancarriger/angularfire2-offline)
7-
[![Dependency Status](https://img.shields.io/david/adriancarriger/angularfire2-offline/master.svg?maxAge=60)](https://david-dm.org/adriancarriger/angularfire2-offline)
8-
[![devDependency Status](https://img.shields.io/david/dev/adriancarriger/angularfire2-offline/master.svg?maxAge=60)](https://david-dm.org/adriancarriger/angularfire2-offline?type=dev)
5+
[![Build Status](http://img.shields.io/travis/adriancarriger/angularfire2-offline/two.svg?maxAge=60)](https://travis-ci.org/adriancarriger/angularfire2-offline)
6+
[![Codecov](https://img.shields.io/codecov/c/github/adriancarriger/angularfire2-offline/two.svg?maxAge=60)](https://codecov.io/gh/adriancarriger/angularfire2-offline)
7+
[![Dependency Status](https://img.shields.io/david/adriancarriger/angularfire2-offline/two.svg?maxAge=60)](https://david-dm.org/adriancarriger/angularfire2-offline)
8+
[![devDependency Status](https://img.shields.io/david/dev/adriancarriger/angularfire2-offline/two.svg?maxAge=60)](https://david-dm.org/adriancarriger/angularfire2-offline?type=dev)
99

1010
- [Complete changelog](https://github.com/adriancarriger/angularfire2-offline/releases)
1111

12+
## <span style="color:red">Important</span>
13+
14+
### This is a legacy branch that supports AngularFire2 version 2.x
15+
16+
For the latest version of AngularFire2 Offline **switch to the [master branch](https://github.com/adriancarriger/angularfire2-offline)**
17+
1218
## Demos
1319

14-
- [`Angular 2+ Demos:`](https://angularfire2-offline.firebaseapp.com/) [Read object](https://angularfire2-offline.firebaseapp.com/read-object), [Read list](https://angularfire2-offline.firebaseapp.com/read-list), [Write object](https://angularfire2-offline.firebaseapp.com/write-object), [Write list](https://angularfire2-offline.firebaseapp.com/write-list) -- [tutorial 📗](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#angular-cli-offline-tutorial-)
15-
- [`Ionic 2+ Demo`](https://ionic-pwa-ad85b.firebaseapp.com) -- [tutorial 📘](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/ionic#ionic-offline-tutorial-)
20+
- [`Angular 2+ Demos:`](https://angularfire2-offline.firebaseapp.com/) [Read object](https://angularfire2-offline.firebaseapp.com/read-object), [Read list](https://angularfire2-offline.firebaseapp.com/read-list), [Write object](https://angularfire2-offline.firebaseapp.com/write-object), [Write list](https://angularfire2-offline.firebaseapp.com/write-list) -- [tutorial 📗](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#angular-cli-offline-tutorial-)
21+
- [`Ionic 2+ Demo`](https://ionic-pwa-ad85b.firebaseapp.com) -- [tutorial 📘](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/ionic#ionic-offline-tutorial-)
1622

17-
[![Example Gif](https://raw.githubusercontent.com/adriancarriger/angularfire2-offline/master/images/example.gif)](https://angularfire2-offline.firebaseapp.com/write-list)
23+
[![Example Gif](https://raw.githubusercontent.com/adriancarriger/angularfire2-offline/two/images/example.gif)](https://angularfire2-offline.firebaseapp.com/write-list)
1824

1925
## Install
2026

2127
```bash
22-
npm install angularfire2-offline angularfire2 firebase --save
28+
npm install angularfire2-offline@two angularfire2@2 firebase@3.6 --save
2329
```
2430

2531
## Setup @NgModule
@@ -54,11 +60,11 @@ export class AppModule { }
5460

5561
## Usage
5662

57-
- Methods mirror AngularFire2 database methods for [`object`](https://github.com/angular/angularfire2/blob/master/docs/2-retrieving-data-as-objects.md#retrieve-data) and [`list`](https://github.com/angular/angularfire2/blob/master/docs/3-retrieving-data-as-lists.md#retrieve-data).
63+
- Methods mirror AngularFire2 database methods for [`object`](https://github.com/angular/angularfire2/blob/two/docs/2-retrieving-data-as-objects.md#retrieve-data) and [`list`](https://github.com/angular/angularfire2/blob/two/docs/3-retrieving-data-as-lists.md#retrieve-data).
5864

5965
### Read Data Offline
6066

61-
- [Querying lists](https://github.com/angular/angularfire2/blob/master/docs/4-querying-lists.md) is supported
67+
- [Querying lists](https://github.com/angular/angularfire2/blob/two/docs/4-querying-lists.md) is supported
6268

6369
```ts
6470
import { Component } from '@angular/core';

examples/angular-cli/README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,25 @@
22

33
How to create an app that loads Firebase data and static resources while offline.
44

5+
## <span style="color:red">Important</span>
6+
7+
### This is a legacy branch that supports AngularFire2 version 2.x
8+
9+
For the latest version of AngularFire2 Offline **switch to the [master branch](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#angular-cli-offline-tutorial-)**
10+
511
## [View Demo](https://angularfire2-offline.firebaseapp.com/)
612

713
## Table of Contents
814

9-
- [Setup Project](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#1-install-angular-cli)
10-
- [Setup @NgModule](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#5-setup-ngmodule)
11-
- [Read Object](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#6-read-an-object---demo)
12-
- [Read List](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#7-read-a-list---demo)
13-
- [Write Object](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#8-write-an-object---demo)
14-
- [Write List](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#9-write-a-list---demo)
15-
- [Run App](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#10-run-your-app)
16-
- [Full Offline Support](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#steps-to-get-full-offline-support-recommended)
17-
- [Testing Locally](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/angular-cli#testing-locally-recommended)
15+
- [Setup Project](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#1-install-angular-cli)
16+
- [Setup @NgModule](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#5-setup-ngmodule)
17+
- [Read Object](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#6-read-an-object---demo)
18+
- [Read List](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#7-read-a-list---demo)
19+
- [Write Object](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#8-write-an-object---demo)
20+
- [Write List](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#9-write-a-list---demo)
21+
- [Run App](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#10-run-your-app)
22+
- [Full Offline Support](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#steps-to-get-full-offline-support-recommended)
23+
- [Testing Locally](https://github.com/adriancarriger/angularfire2-offline/tree/two/examples/angular-cli#testing-locally-recommended)
1824

1925
## Steps to create project
2026

@@ -52,7 +58,7 @@ Now that you have a new project setup, install [AngularFire2Offline](https://www
5258

5359
### 5. Setup @NgModule
5460

55-
Open [`/src/app/app.module.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/app.module.ts), inject the Firebase providers, and specify your Firebase configuration.
61+
Open [`/src/app/app.module.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/app.module.ts), inject the Firebase providers, and specify your Firebase configuration.
5662
This can be found in your project at [the Firebase Console](https://console.firebase.google.com):
5763

5864
```ts
@@ -90,7 +96,7 @@ export class AppModule { }
9096

9197
### 6. Read an object - [Demo](https://angularfire2-offline.firebaseapp.com/read-object)
9298

93-
In [`/src/app/examples/read-object/read-object.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/read-object/read-object.component.ts):
99+
In [`/src/app/examples/read-object/read-object.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/read-object/read-object.component.ts):
94100

95101
```ts
96102
import { Component, OnInit } from '@angular/core';
@@ -109,15 +115,15 @@ export class ReadObjectComponent {
109115
}
110116
```
111117

112-
In [`/src/app/examples/read-object/read-object.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/read-object/read-object.component.html):
118+
In [`/src/app/examples/read-object/read-object.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/read-object/read-object.component.html):
113119

114120
```html
115121
<h2>{{ (info | async)?.title }}</h2>
116122
```
117123

118124
### 7. Read a list - [Demo](https://angularfire2-offline.firebaseapp.com/read-list)
119125

120-
In [`/src/app/examples/read-list/read-list.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/read-list/read-list.component.ts):
126+
In [`/src/app/examples/read-list/read-list.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/read-list/read-list.component.ts):
121127

122128
```ts
123129
import { Component, OnInit } from '@angular/core';
@@ -136,7 +142,7 @@ export class ReadListComponent {
136142
}
137143
```
138144

139-
In [`/src/app/examples/read-list/read-list.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/read-list/read-list.component.html):
145+
In [`/src/app/examples/read-list/read-list.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/read-list/read-list.component.html):
140146

141147
```html
142148
<ul>
@@ -148,7 +154,7 @@ In [`/src/app/examples/read-list/read-list.component.html`](https://github.com/a
148154

149155
### 8. Write an object - [Demo](https://angularfire2-offline.firebaseapp.com/write-object)
150156

151-
In [`/src/app/examples/write-object/write-object.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/write-object/write-object.component.ts):
157+
In [`/src/app/examples/write-object/write-object.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/write-object/write-object.component.ts):
152158

153159
```ts
154160
import { Component, OnInit } from '@angular/core';
@@ -194,7 +200,7 @@ export class WriteObjectComponent {
194200
}
195201
```
196202

197-
In [`/src/app/examples/write-object/write-object.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/write-object/write-object.component.html):
203+
In [`/src/app/examples/write-object/write-object.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/write-object/write-object.component.html):
198204

199205
```html
200206
<button (click)="increaseSpeed()">Speed +1</button>
@@ -207,7 +213,7 @@ In [`/src/app/examples/write-object/write-object.component.html`](https://github
207213

208214
### 9. Write a list - [Demo](https://angularfire2-offline.firebaseapp.com/write-list)
209215

210-
In [`/src/app/examples/write-list/write-list.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/write-list/write-list.component.ts):
216+
In [`/src/app/examples/write-list/write-list.component.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/write-list/write-list.component.ts):
211217

212218
```ts
213219
import { Component, OnInit } from '@angular/core';
@@ -244,7 +250,7 @@ export class WriteListComponent {
244250
}
245251
```
246252

247-
In [`/src/app/examples/write-list/write-list.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/app/examples/write-list/write-list.component.html):
253+
In [`/src/app/examples/write-list/write-list.component.html`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/app/examples/write-list/write-list.component.html):
248254

249255
```html
250256

@@ -282,7 +288,7 @@ The following steps are based on [this tutorial](https://coryrylan.com/blog/fast
282288

283289
### 1. Add a service worker
284290

285-
In [`/src/index.html`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/index.html#L12-L20) add the following just before the closing `body` tag:
291+
In [`/src/index.html`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/index.html#L12-L20) add the following just before the closing `body` tag:
286292

287293
```html
288294
<script>
@@ -298,11 +304,11 @@ In [`/src/index.html`](https://github.com/adriancarriger/angularfire2-offline/bl
298304

299305
### 2. Add `service-worker.js`
300306

301-
Create an empty file called `service-worker.js` located at [`/src/service-worker.js`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/src/service-worker.js)
307+
Create an empty file called `service-worker.js` located at [`/src/service-worker.js`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/src/service-worker.js)
302308

303309
### 3. Add assets
304310

305-
In [`/angular-cli.json`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/angular-cli.json#L11-L15) add `service-worker.js` to the assets array:
311+
In [`/angular-cli.json`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/angular-cli.json#L11-L15) add `service-worker.js` to the assets array:
306312

307313
```json
308314
"assets": [
@@ -320,7 +326,7 @@ npm install sw-precache --save-dev
320326

321327
### 5. Add `package.json` scripts
322328

323-
In [`/package.json`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/package.json#L12-L13) add the `sw` and `build:prod` scripts:
329+
In [`/package.json`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/package.json#L12-L13) add the `sw` and `build:prod` scripts:
324330

325331
```json
326332
"scripts": {
@@ -336,7 +342,7 @@ In [`/package.json`](https://github.com/adriancarriger/angularfire2-offline/blob
336342

337343
### 6. Create `sw-precache-config.js`
338344

339-
In the root of your project create a file called [`sw-precache-config.js`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/sw-precache-config.js) with the following config:
345+
In the root of your project create a file called [`sw-precache-config.js`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/sw-precache-config.js) with the following config:
340346

341347
```js
342348
module.exports = {
@@ -350,6 +356,7 @@ module.exports = {
350356
]
351357
};
352358
```
359+
353360
You can also add other items to the staticFileGlobs array such as:
354361

355362
- `'dist/assets/**'` to cache assets
@@ -373,7 +380,7 @@ npm install live-server --save-dev
373380

374381
### 2. Add `static-serve` script
375382

376-
In [`/package.json`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/angular-cli/package.json#L14) add the `static-serve` script:
383+
In [`/package.json`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/angular-cli/package.json#L14) add the `static-serve` script:
377384

378385
```json
379386
"scripts": {
@@ -405,4 +412,4 @@ At [localhost:4200](http://localhost:4200/) you should see your app running.
405412

406413
## Further help
407414

408-
To get more help on the `angular-cli` use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
415+
To get more help on the `angular-cli` use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/two/README.md).

examples/ionic/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
How to create an app that loads Firebase data and static resources while offline.
44

5+
## <span style="color:red">Important</span>
6+
7+
### This is a legacy branch that supports AngularFire2 version 2.x
8+
9+
For the latest version of AngularFire2 Offline **switch to the [master branch](https://github.com/adriancarriger/angularfire2-offline/tree/master/examples/ionic#ionic-offline-tutorial-)**
10+
511
## [View Demo](https://ionic-pwa-ad85b.firebaseapp.com)
612

713
## Steps to create project
@@ -11,6 +17,7 @@ How to create an app that loads Firebase data and static resources while offline
1117
```bash
1218
npm install -g cordova ionic
1319
```
20+
1421
### 2. Create a new project
1522

1623
```bash
@@ -36,7 +43,7 @@ Now that you have a new project setup, install [AngularFire2Offline](https://www
3643

3744
### 5. Setup @NgModule
3845

39-
Open [`/src/app/app.module.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/ionic/src/app/app.module.ts), inject the Firebase providers, and specify your Firebase configuration.
46+
Open [`/src/app/app.module.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/ionic/src/app/app.module.ts), inject the Firebase providers, and specify your Firebase configuration.
4047
This can be found in your project at [the Firebase Console](https://console.firebase.google.com):
4148

4249
```ts
@@ -87,7 +94,7 @@ export class AppModule { }
8794

8895
### 6. Use in a component
8996

90-
In [`/src/pages/home/home.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/ionic/src/pages/home/home.ts):
97+
In [`/src/pages/home/home.ts`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/ionic/src/pages/home/home.ts):
9198

9299
```ts
93100
import { Component } from '@angular/core';
@@ -112,7 +119,8 @@ export class HomePage {
112119
}
113120
}
114121
```
115-
In [`/src/pages/home/home.html`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/ionic/src/pages/home/home.html):
122+
123+
In [`/src/pages/home/home.html`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/ionic/src/pages/home/home.html):
116124

117125
```html
118126
<ion-header>
@@ -145,7 +153,7 @@ At this point everything should be working, including offline support for your F
145153

146154
### 1. Add a service worker
147155

148-
In [`/src/index.html`](https://github.com/adriancarriger/angularfire2-offline/blob/master/examples/ionic/src/index.html#L17-L23) find and uncomment the provided service worker script:
156+
In [`/src/index.html`](https://github.com/adriancarriger/angularfire2-offline/blob/two/examples/ionic/src/index.html#L17-L23) find and uncomment the provided service worker script:
149157

150158
```html
151159
<script>
@@ -162,6 +170,7 @@ In [`/src/index.html`](https://github.com/adriancarriger/angularfire2-offline/bl
162170
```bash
163171
ionic serve
164172
```
173+
165174
At [localhost:8100](http://localhost:8100/) you should see your app running.
166175

167176
### 3. Disconnect internet and refresh

0 commit comments

Comments
 (0)