Skip to content

Commit 9293dc6

Browse files
jamesdanielsdavideast
authored andcommitted
Bind messaging (angular#1889)
* fix(messaging): Fix for the binding issue and onTokenRefresh for Messaging * chore(): 5.0.1 changelog and version bump * chore(): 5.0.2 changelog * docs(messaging): typo, closes angular#1888
1 parent 858626f commit 9293dc6

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
<a name="5.0.2"></a>
2+
## [5.0.2](https://github.com/angular/angularfire2/compare/5.0.1...5.0.2) (2018-09-21)
3+
4+
### Bug Fixes
5+
6+
* **messaging:** Fix for the binding issue and onTokenRefresh for Messaging ([e170da1](https://github.com/angular/angularfire2/commit/e170da1))
7+
8+
9+
<a name="5.0.1"></a>
10+
# [5.0.1](https://github.com/angular/angularfire2/compare/5.0.0...5.0.1) (2018-09-07)
11+
12+
Version 5.0.1 has been released for the deprecated `angularfire2` NPM library; this simply re-exports everything from `@angular/fire`; allowing you to use either `angularfire2` or `@angular/fire` in your imports and `package.json`.
13+
14+
It will have it's dependency pinned to the corresponding minor and will be released alongside future `@angular/fire` releases for the rest of the 5.x series.
15+
16+
117
<a name="5.0.0"></a>
218
# [5.0.0](https://github.com/angular/angularfire2/compare/5.0.0-rc.12...5.0.0) (2018-09-04)
319

docs/messaging/messaging.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { BrowserModule } from '@angular/platform-browser';
1515
import { NgModule } from '@angular/core';
1616
import { AppComponent } from './app.component';
1717
import { AngularFireModule } from '@angular/fire';
18-
import { AngularFireStorageModule } from '@angular/fire/messaging';
18+
import { AngularFireMessagingModule } from '@angular/fire/messaging';
1919
import { environment } from '../environments/environment';
2020

2121
@NgModule({

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularfire2",
3-
"version": "5.0.0",
3+
"version": "5.0.2",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
@@ -12,7 +12,7 @@
1212
"delayed_karma": "sleep 10 && karma start",
1313
"build": "rm -rf dist && node tools/build.js",
1414
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
15-
"build:wrapper": "npm i --prefix wrapper && VERSION=5.0.0 npm run --prefix wrapper build"
15+
"build:wrapper": "npm i --prefix wrapper && VERSION=5.0.2 npm run --prefix wrapper build"
1616
},
1717
"keywords": [
1818
"angular",

src/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@angular/fire",
33
"version": "ANGULARFIRE2_VERSION",
4-
"description": "The core module",
4+
"description": "The official library for Firebase and Angular",
55
"main": "./bundles/core.umd.js",
66
"module": "index.js",
77
"es2015": "es2015/index.js",

src/messaging/messaging.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export class AngularFireMessaging {
5353
);
5454

5555
const tokenChanges = this.messaging.pipe(
56-
switchMap(messaging => new Observable(messaging.onTokenRefresh)),
56+
switchMap(messaging => new Observable(messaging.onTokenRefresh.bind(messaging)).pipe(
57+
switchMap(() => messaging.getToken())
58+
)),
5759
runOutsideAngular(zone)
5860
);
5961

@@ -62,7 +64,7 @@ export class AngularFireMessaging {
6264
);
6365

6466
this.messages = this.messaging.pipe(
65-
switchMap(messaging => new Observable(messaging.onMessage)),
67+
switchMap(messaging => new Observable(messaging.onMessage.bind(messaging))),
6668
runOutsideAngular(zone)
6769
);
6870

0 commit comments

Comments
 (0)