Skip to content

Commit

Permalink
fix(package): support for angular alpha 52 & rxjs alpha 13
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Dec 12, 2015
1 parent 8bb3f9b commit d81a844
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
"typings": "./ng2-translate.d.ts",
"homepage": "https://github.com/ocombe/ng2-translate",
"dependencies": {
"rxjs": "5.0.0-alpha.11",
"angular2": "2.0.0-alpha.48"
"angular2": "2.0.0-alpha.52",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-alpha.14",
"zone.js": "0.5.8"
},
"devDependencies": {
"commitizen": "~2.4.6",
Expand All @@ -40,7 +44,7 @@
"karma-jasmine": "~0.3.6",
"semantic-release": "~4.3.5",
"systemjs": "~0.19.6",
"typescript": "~1.6.2"
"typescript": "~1.7.3"
},
"czConfig": {
"path": "node_modules/cz-conventional-changelog"
Expand Down
14 changes: 5 additions & 9 deletions src/translate.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import {Injectable, EventEmitter} from 'angular2/angular2';
import {Http, Response} from 'angular2/http';
// doc: https://github.com/ReactiveX/RxJS/blob/master/doc/operator-creation.md
import {Observable} from 'rxjs/Observable';
// todo just use Observable.of when using rxjs alpha > 11
import {ArrayObservable} from 'rxjs/observable/fromArray'
import 'rxjs/operators/share';
// todo uncomment this once using rxjs alpha > 11
//import 'rxjs/add/operator/share';
import {Observable} from 'rxjs/Observable'
import 'rxjs/add/observable/fromArray.js';
import 'rxjs/add/operator/share.js';

import {Parser} from './translate.parser';

Expand Down Expand Up @@ -109,7 +105,7 @@ export class TranslateService {
} else { // we have this language, return an Observable
this.changeLang(lang);

return ArrayObservable.of(this.translations[lang]);
return Observable.of(this.translations[lang]);
}
}

Expand Down Expand Up @@ -157,7 +153,7 @@ export class TranslateService {
if(this.pending) {
return this.pending.map((res: any) => this.parser.interpolate(res[key], interpolateParams) || key);
} else {
return ArrayObservable.of(this.translations && this.translations[this.currentLang]
return Observable.of(this.translations && this.translations[this.currentLang]
? this.parser.interpolate(this.translations[this.currentLang][key], interpolateParams) : key || key);
}
}
Expand Down

0 comments on commit d81a844

Please sign in to comment.