Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // component
- onClick(record){
- this.myService.updateRecord(params).subscribe();
- }
- // service
- updateRecord(record){
- return new Observable((observer) => {
- Observable.forkJoin(
- Observable.fromPromise(this.storage.get('things')),
- Observable.fromPromise(this.storage.get('other_things'))
- ).subscribe(
- (results) => {
- let things = results[0] || []
- let other_things = results[1] || []
- // do stuffs
- observer.next([record])
- observer.complete()
- })
- })
- }
Add Comment
Please, Sign In to add comment