Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/package.json b/package.json
- index d204f70..4f6a190 100755
- --- a/package.json
- +++ b/package.json
- @@ -10,41 +10,41 @@
- "ionic:serve": "ionic-app-scripts serve"
- },
- "dependencies": {
- - "@angular/common": "2.2.1",
- - "@angular/compiler": "2.2.1",
- - "@angular/compiler-cli": "2.2.1",
- - "@angular/core": "2.2.1",
- - "@angular/forms": "2.2.1",
- - "@angular/http": "2.2.1",
- - "@angular/platform-browser": "2.2.1",
- - "@angular/platform-browser-dynamic": "2.2.1",
- - "@angular/platform-server": "2.2.1",
- - "@ionic/storage": "1.1.7",
- - "angular2-moment": "^1.1.0",
- - "angular2-emojify": "0.1.0",
- - "ionic-angular": "2.3.0",
- - "ionic-native": "2.9.0",
- + "@angular/common": "4.0.0",
- + "@angular/compiler": "4.0.0",
- + "@angular/compiler-cli": "4.0.0",
- + "@angular/core": "4.0.0",
- + "@angular/forms": "4.0.0",
- + "@angular/http": "4.0.0",
- + "@angular/platform-browser": "4.0.0",
- + "@angular/platform-browser-dynamic": "4.0.0",
- + "@ionic-native/camera": "^3.5.0",
- + "@ionic-native/core": "3.4.2",
- + "@ionic-native/splash-screen": "3.4.2",
- + "@ionic-native/status-bar": "3.4.2",
- + "@ionic-native/transfer": "^3.4.4",
- + "@ionic/storage": "2.0.1",
- + "ionic-angular": "3.0.1",
- "ionicons": "3.0.0",
- - "rxjs": "5.0.0-beta.12",
- + "rxjs": "5.1.1",
- "sw-toolbox": "3.4.0",
- - "zone.js": "0.6.26"
- + "zone.js": "^0.8.4"
- },
- "devDependencies": {
- - "@ionic/app-scripts": "1.0.0",
- - "typescript": "2.0.9"
- + "@ionic/app-scripts": "1.3.0",
- + "typescript": "~2.2.1"
- },
- "cordovaPlugins": [
- - "cordova-plugin-whitelist",
- - "cordova-plugin-console",
- - "cordova-plugin-statusbar",
- "cordova-plugin-device",
- "cordova-plugin-splashscreen",
- - "cordova-plugin-inappbrowser",
- - "cordova-plugin-file-transfer",
- - "cordova-plugin-actionsheet",
- - "cordova-plugin-camera",
- + "cordova-plugin-console",
- + "cordova-plugin-whitelist",
- + "cordova-plugin-statusbar",
- "ionic-plugin-keyboard"
- ],
- "cordovaPlatforms": [],
- - "description": "TootyFruity: An Ionic project"
- + "description": "scratch: An Ionic project",
- + "config": {
- + "ionic_webpack": "./webpack.config.js"
- + }
- }
- diff --git a/src/components/media-attachments/media-attachments.ts b/src/components/media-attachments/media-attachments.ts
- index c6fed33..4155f40 100644
- --- a/src/components/media-attachments/media-attachments.ts
- +++ b/src/components/media-attachments/media-attachments.ts
- @@ -1,6 +1,6 @@
- import { Platform } from 'ionic-angular';
- import { ImageSliderPage } from '../../pages/image-slider/image-slider';
- -import { ModalController } from 'ionic-angular/components/modal/modal';
- +import { ModalController } from 'ionic-angular';
- import { MediaAttachment } from '../../apiClasses/media-attachment';
- import { Component, ElementRef, Input } from '@angular/core';
- @@ -46,7 +46,7 @@ export class MediaAttachmentsComponent {
- if(!this.isiOS) {
- video.webkitRequestFullscreen();
- }
- - });
- + });
- }
- }
- diff --git a/src/components/slidable-toot/slidable-toot.ts b/src/components/slidable-toot/slidable-toot.ts
- index 9aafd8b..344f14e 100644
- --- a/src/components/slidable-toot/slidable-toot.ts
- +++ b/src/components/slidable-toot/slidable-toot.ts
- @@ -2,9 +2,9 @@ import { Utility } from '../../providers/utility';
- import { UserProfilePage } from '../../pages/user-profile/user-profile';
- import { TootDetailPage } from '../../pages/toot-detail/toot-detail';
- import { Account } from '../../apiClasses/account';
- -import { ToastController } from 'ionic-angular/components/toast/toast';
- +import { ToastController } from 'ionic-angular';
- import { ReplyTootPage } from '../../pages/reply-toot/reply-toot';
- -import { ModalController } from 'ionic-angular/components/modal/modal';
- +import { ModalController } from 'ionic-angular';
- import { ItemSliding, NavController } from 'ionic-angular';
- import { APIProvider } from '../../providers/APIProvider';
- import { Toot } from '../../apiClasses/toot';
- @@ -40,7 +40,7 @@ export class SlidableTootComponent {
- this.navController.push(UserProfilePage, {'mention' : this.toot.mentions[i]});
- }
- }
- - });
- + });
- }
- }
- @@ -58,7 +58,7 @@ export class SlidableTootComponent {
- document.getElementById(toot.id).className += ' newly_unboosted';
- setTimeout(() => {
- document.getElementById(toot.id).className = originalClass;
- - toot.reblogged = false;
- + toot.reblogged = false;
- }, 1500);
- })
- } else {
- @@ -68,7 +68,7 @@ export class SlidableTootComponent {
- .subscribe(() => {
- let originalClass = document.getElementById(toot.id).className;
- document.getElementById(toot.id).className += ' newly_boosted'
- - toot.reblogged = true;
- + toot.reblogged = true;
- setTimeout(() => {
- document.getElementById(toot.id).className = originalClass;
- }, 2000);
- @@ -108,12 +108,12 @@ export class SlidableTootComponent {
- toot.favourited = true;
- setTimeout(() => {
- document.getElementById(toot.id).className = originalClass;
- -
- +
- }, 2000);
- },
- error => console.log(JSON.stringify(error))
- );
- -
- +
- }
- }
- @@ -136,7 +136,7 @@ export class SlidableTootComponent {
- document.getElementById(toot.id).className = originalClass
- }, 2000)
- }
- -
- +
- showPrivateInfoToast(slidingItem: ItemSliding){
- let toast = this.toaster.create({
- @@ -145,7 +145,7 @@ export class SlidableTootComponent {
- position: 'top'
- });
- toast.present();
- - slidingItem.close();
- + slidingItem.close();
- }
- goToUserProfile(account: Account){
- diff --git a/src/components/toot-form/toot-form.ts b/src/components/toot-form/toot-form.ts
- index 6504885..12e24ba 100644
- --- a/src/components/toot-form/toot-form.ts
- +++ b/src/components/toot-form/toot-form.ts
- @@ -1,12 +1,17 @@
- import { ImageSliderPage } from '../../pages/image-slider/image-slider';
- -import { ModalController } from 'ionic-angular/components/modal/modal';
- -import { Camera, CameraOptions, FileUploadResult } from 'ionic-native/dist/esm';
- +import { Camera, CameraOptions } from '@ionic-native/camera';
- +
- import { UploadedMedia } from '../../apiClasses/uploaded-media';
- import { Component, Input } from '@angular/core';
- -import { NavController, NavParams, Platform, ToastController, ViewController } from 'ionic-angular';
- +import {
- + NavController, NavParams, Platform, ToastController, ViewController, ModalController, ActionSheetController,
- + ActionSheetOptions,
- +
- +} from 'ionic-angular';
- import { TootForm } from '../../apiClasses/tootForm'
- -import { Keyboard, ActionSheet } from 'ionic-native';
- import { APIProvider } from '../../providers/APIProvider';
- +import {Keyboard} from '@ionic-native/keyboard';
- +import {FileUploadResult} from "@ionic-native/transfer";
- /*
- Generated class for the TootForm component.
- @@ -21,7 +26,7 @@ export class TootFormComponent {
- @Input()
- newToot: TootForm;
- -
- +
- spoilerFieldState: string = 'hidden';
- @Input()
- spoilerToggle: Boolean;
- @@ -33,22 +38,23 @@ export class TootFormComponent {
- attachedMedia: UploadedMedia[] = [];
- - constructor(platform: Platform, public modalController: ModalController, public toaster: ToastController,
- - public navCtrl: NavController, public navParams: NavParams, private mastodon: APIProvider,
- - public viewCtrl: ViewController) {
- + constructor(platform: Platform, public modalController: ModalController, public toaster: ToastController,
- + public navCtrl: NavController, public navParams: NavParams, private mastodon: APIProvider,
- + public viewCtrl: ViewController, public camera: Camera,
- + public keyboard: Keyboard, public asc: ActionSheetController) {
- let options : any = {}
- - options.sourceType = Camera.PictureSourceType.PHOTOLIBRARY;
- - options.mediaType=Camera.MediaType.ALLMEDIA;
- + options.sourceType = camera.PictureSourceType.PHOTOLIBRARY;
- + options.mediaType=camera.MediaType.ALLMEDIA;
- options.quality = 100;
- if(platform.is('ios')){
- console.log('platform is ios, setting image destination type to native...')
- - options.destinationType=Camera.DestinationType.NATIVE_URI;
- + options.destinationType=camera.DestinationType.NATIVE_URI;
- } else {
- - options.destinationType=Camera.DestinationType.FILE_URI;
- + options.destinationType=camera.DestinationType.FILE_URI;
- }
- this.picturePickerOptions = options;
- - Keyboard.disableScroll(true);
- + keyboard.disableScroll(true);
- this.newToot = new TootForm();
- }
- @@ -69,7 +75,7 @@ export class TootFormComponent {
- duration: 3000,
- position: 'top'
- });
- - toast.present();
- + toast.present();
- } else if(this.remainingCharacters < 0) {
- let toast = this.toaster.create({
- message: 'Wow! You used too many characters, try shortening it down',
- @@ -77,7 +83,7 @@ export class TootFormComponent {
- position: 'top'
- });
- toast.present();
- - }
- + }
- else {
- console.log('posting new toot...')
- console.log(this.newToot.spoiler_text)
- @@ -93,7 +99,7 @@ export class TootFormComponent {
- if(this.newToot.in_reply_to_id == null) {
- localStorage.setItem('lastVisibility', this.newToot.visibility);
- }
- - toast.present();
- + toast.present();
- this.newToot = new TootForm();
- },
- error => console.log(JSON.stringify(error))
- @@ -117,7 +123,7 @@ export class TootFormComponent {
- this.newToot.spoiler_text = null;
- this.spoilerFieldState = 'hidden'
- }
- - Keyboard.disableScroll(true);
- + this.keyboard.disableScroll(true);
- }
- countTootLength(){
- @@ -125,7 +131,7 @@ export class TootFormComponent {
- let tootContentLength = 0;
- if(this.newToot.spoiler_text) {
- spoilerTextLength = this.newToot.spoiler_text.length;
- - }
- + }
- if(this.newToot.status){
- tootContentLength = this.newToot.status.length
- }
- @@ -146,12 +152,14 @@ export class TootFormComponent {
- return;
- }
- let buttonLabels = ['Fast Upload', 'Full Size (and GIFs!)'];
- - ActionSheet.show({
- + let as = this.asc.create({
- 'title': 'How do you want to upload?',
- 'buttonLabels': buttonLabels,
- 'addCancelButtonWithLabel': 'Cancel',
- 'androidTheme' : 5
- - }).then((buttonIndex: number) => {
- + } as ActionSheetOptions);
- +
- + as.present().then((buttonIndex: number) => {
- switch(buttonIndex){
- case(1):
- this.picturePickerOptions.quality = 60;
- @@ -170,7 +178,7 @@ export class TootFormComponent {
- }
- singleImagePicker(){
- - Camera.getPicture(this.picturePickerOptions).then((imgURL) => {
- + this.camera.getPicture(this.picturePickerOptions).then((imgURL) => {
- this.uploadMedia(imgURL);
- }, (err) => { console.log(JSON.stringify(err))});
- }
- @@ -188,7 +196,7 @@ export class TootFormComponent {
- });
- toast.present();
- return null;
- - }
- + }
- promise.then((data) => {
- if(data){
- if(!this.newToot.media_ids){
- @@ -200,9 +208,9 @@ export class TootFormComponent {
- this.newToot.status = this.newToot.status + " " + attachment.text_url;
- else
- this.newToot.status = " " + attachment.text_url;
- - console.log(JSON.stringify(this.newToot.media_ids));
- + console.log(JSON.stringify(this.newToot.media_ids));
- this.attachedMedia.push(attachment);
- - this.countTootLength();
- + this.countTootLength();
- this.isUploading = false;
- }
- }, (error) => {
- @@ -213,23 +221,23 @@ export class TootFormComponent {
- }
- removeAttachment(media:UploadedMedia){
- -
- +
- //remove attachment from view
- let index = this.attachedMedia.indexOf(media);
- this.attachedMedia.splice(index,1);
- -
- +
- //remove attachment from newToot object
- index = this.newToot.media_ids.indexOf(media.id)
- this.newToot.media_ids.splice(index,1);
- -
- +
- let startOfMediaURL = this.newToot.status.indexOf(media.text_url);
- let status_part_one = this.newToot.status.substring(0,startOfMediaURL -1)
- -
- -
- +
- +
- let status_part_two = this.newToot.status.substring(startOfMediaURL + media.text_url.length)
- -
- +
- console.log("old status: " + this.newToot.status);
- this.newToot.status = status_part_one + status_part_two;
- console.log("p1 '" + status_part_one+"'");
- @@ -249,5 +257,5 @@ export class TootFormComponent {
- let myModal = this.modalController.create(ImageSliderPage, { 'mediaAttachments' : this.attachedMedia, 'slideFromNumber': index});
- myModal.present();
- }
- -
- +
- }
- diff --git a/src/pages/account-switcher/account-switcher.ts b/src/pages/account-switcher/account-switcher.ts
- index b9ddb97..c09d863 100644
- --- a/src/pages/account-switcher/account-switcher.ts
- +++ b/src/pages/account-switcher/account-switcher.ts
- @@ -2,10 +2,9 @@ import { SwitcherService } from '../../providers/switcherService';
- import { Utility } from '../../providers/utility';
- import { APIProvider } from '../../providers/APIProvider';
- import { LoginPage } from '../login/login';
- -import { ModalController } from 'ionic-angular/components/modal/modal';
- import { AuthedAccount } from '../../apiClasses/authedAccount';
- import { Component } from '@angular/core';
- -import { NavController, NavParams, ViewController } from 'ionic-angular';
- +import { NavController, NavParams, ViewController, ModalController } from 'ionic-angular';
- /*
- Generated class for the AccountSwitcher page.
- @@ -49,7 +48,7 @@ export class AccountSwitcherPage {
- removeAccount(account:AuthedAccount){
- let accountList: AuthedAccount[] = JSON.parse(localStorage.getItem('accountList'));
- -
- +
- for(let i = 0; i < accountList.length; i++){
- if(accountList[i].accessToken == account.accessToken) {
- accountList.splice(i,1);
- diff --git a/src/pages/home/home.ts b/src/pages/home/home.ts
- index b13d040..3df2c85 100755
- --- a/src/pages/home/home.ts
- +++ b/src/pages/home/home.ts
- @@ -1,10 +1,10 @@
- import { Subscription } from 'rxjs/Rx';
- import { SwitcherService } from '../../providers/switcherService';
- -import { PopoverController } from 'ionic-angular/components/popover/popover';
- +import { PopoverController } from 'ionic-angular';
- import { AccountSwitcherPage } from '../account-switcher/account-switcher';
- import { AuthedAccount } from '../../apiClasses/authedAccount';
- import { Utility } from '../../providers/utility';
- -import { ToastController } from 'ionic-angular/components/toast/toast';
- +import { ToastController } from 'ionic-angular';
- import { APIProvider } from '../../providers/APIProvider';
- import { Component, OnDestroy, Renderer, ViewChild } from '@angular/core';
- import { Content, InfiniteScroll, ModalController, NavController } from 'ionic-angular';
- @@ -25,7 +25,7 @@ export class HomePage implements OnDestroy{
- timelineSwitching: boolean = false;
- @ViewChild(Content) content: Content;
- - constructor(public utility: Utility, public navCtrl: NavController, private renderer: Renderer, public toaster: ToastController,
- + constructor(public utility: Utility, public navCtrl: NavController, private renderer: Renderer, public toaster: ToastController,
- private mastodon: APIProvider, public modalController: ModalController, public popOverController: PopoverController, private switcherService : SwitcherService) {
- this.currentAccount = utility.getCurrentAccount();
- let tootCache = this.currentAccount.tootCache;
- @@ -48,7 +48,7 @@ export class HomePage implements OnDestroy{
- this.loadTimeline();
- }
- })
- -
- +
- }
- public cacheContent(){
- @@ -81,8 +81,8 @@ export class HomePage implements OnDestroy{
- actualTootID(toot: Toot): string {
- if(toot.reblog)
- return toot.reblog.id;
- - else
- - return toot.id;
- + else
- + return toot.id;
- }
- doRefresh(refresher) {
- @@ -114,9 +114,9 @@ export class HomePage implements OnDestroy{
- if(newToots.length < 20) {
- this.toots = newToots.concat(this.toots);
- } else {
- - this.toots = newToots;
- + this.toots = newToots;
- }
- - }
- + }
- setTimeout(() => {
- console.log('refresh completed');
- refresher.complete();
- @@ -149,7 +149,7 @@ export class HomePage implements OnDestroy{
- error => {
- console.log(JSON.stringify(error))
- infiniteScroll.complete();
- - }
- + }
- );
- }
- diff --git a/src/pages/image-slider/image-slider.ts b/src/pages/image-slider/image-slider.ts
- index c20fb99..f72b916 100644
- --- a/src/pages/image-slider/image-slider.ts
- +++ b/src/pages/image-slider/image-slider.ts
- @@ -1,4 +1,4 @@
- -import { ModalController } from 'ionic-angular/components/modal/modal';
- +import { ModalController } from 'ionic-angular';
- import { MediaAttachment } from '../../apiClasses/media-attachment';
- import { Component } from '@angular/core';
- import { NavController, NavParams, ViewController } from 'ionic-angular';
- @@ -12,12 +12,12 @@ export class ImageSliderPage {
- slideFromNumber: number;
- constructor(
- public navCtrl: NavController,
- - public navParams: NavParams,
- + public navParams: NavParams,
- public viewCtrl: ViewController,
- public modalController: ModalController) {
- this.mediaAttachments = navParams.get('mediaAttachments');
- this.slideFromNumber = navParams.get('slideFromNumber');
- -
- +
- }
- ionViewDidLoad() {
- diff --git a/src/pages/user-profile/user-profile.ts b/src/pages/user-profile/user-profile.ts
- index 7d8c2fe..125e69a 100644
- --- a/src/pages/user-profile/user-profile.ts
- +++ b/src/pages/user-profile/user-profile.ts
- @@ -5,7 +5,7 @@ import { Utility } from '../../providers/utility';
- import { UserListPage } from '../user-list/user-list';
- import { UserOptionsPage } from '../user-options/user-options';
- import { TootPage } from '../toot/toot';
- -import { ModalController } from 'ionic-angular/components/modal/modal';
- +import { ModalController } from 'ionic-angular';
- import { Relationships } from '../../apiClasses/relationships';
- import { Mention } from '../../apiClasses/mention';
- import { APIProvider } from '../../providers/APIProvider';
- @@ -36,7 +36,7 @@ export class UserProfilePage {
- constructor(private utility:Utility, private modalController: ModalController, public navCtrl: NavController,
- public navParams: NavParams, private mastodon: APIProvider, public popOverController: PopoverController, private switcherService: SwitcherService) {
- -
- +
- let paramUser = navParams.get('account');
- let paramMention: Mention = navParams.get('mention');
- @@ -47,12 +47,12 @@ export class UserProfilePage {
- this.getToots();
- this.loadRelationships();
- }
- - // user comes from Mention
- + // user comes from Mention
- else if(paramMention && paramMention.id != loggedInUser.id){
- this.user = new Account();
- this.user.acct = paramMention.acct;
- this.mastodon.getAccount(paramMention.id)
- - .map(
- + .map(
- res => {
- return JSON.parse(res['_body'])
- })
- @@ -63,7 +63,7 @@ export class UserProfilePage {
- this.loadRelationships();
- }
- )
- - }
- + }
- // is logged in user
- else {
- this.loggedInUser = loggedInUser;
- @@ -190,7 +190,7 @@ export class UserProfilePage {
- error => {
- console.log(JSON.stringify(error))
- infiniteScroll.complete();
- - }
- + }
- );
- }
- @@ -226,7 +226,7 @@ export class UserProfilePage {
- showFollowers(){
- this.navCtrl.push(UserListPage, {title: "Followers", id: this.user.id});
- -
- +
- }
- showFollowing(){
- diff --git a/src/providers/APIProvider.ts b/src/providers/APIProvider.ts
- index 90f07fd..676d8ee 100644
- --- a/src/providers/APIProvider.ts
- +++ b/src/providers/APIProvider.ts
- @@ -1,9 +1,9 @@
- import { Utility } from './utility';
- import { AuthedAccount } from '../apiClasses/authedAccount';
- -import { FileUploadOptions, FileUploadResult } from 'ionic-native/dist/esm';
- +import { FileUploadOptions, FileUploadResult } from '@ionic-native/transfer';
- import { TootForm } from '../apiClasses/tootForm';
- import { RequestOptionsArgs } from '@angular/http/src/interfaces';
- -import { Transfer } from 'ionic-native';
- +import { Transfer } from '@ionic-native/transfer';
- import { Observable } from 'rxjs/Rx';
- import { Injectable } from '@angular/core';
- import { Headers, Http, RequestOptions, Response, URLSearchParams } from '@angular/http';
- @@ -13,12 +13,12 @@ import 'rxjs/add/operator/catch';
- @Injectable()
- export class APIProvider {
- - fileTransfer: Transfer;
- currentAccount: AuthedAccount;
- mediaUploadsProgress:any = {};
- - constructor(public http: Http, public storage: Storage, public utility: Utility) {
- + constructor(public http: Http, public storage: Storage, public utility: Utility,
- + public transfer: Transfer) {
- this.currentAccount = utility.getCurrentAccount();
- let headers = new Headers({ 'Accept': 'application/json' });
- @@ -127,7 +127,7 @@ export class APIProvider {
- }
- uploadMedia(fileURL: string): Promise<FileUploadResult>{
- - this.fileTransfer = new Transfer();
- + let fileTransfer = this.transfer.create();
- let options: any = {};
- let mediaType = fileURL.substring(fileURL.lastIndexOf('.'));
- //.GIF?BSDFH
- @@ -144,16 +144,16 @@ export class APIProvider {
- options.fileName = "tootyFruity_image.jpg"
- break;
- case('.png'):
- - options.mimeType = "image/png"
- + options.mimeType = "image/png"
- options.fileName = "tootyFruity_image.png"
- break;
- case('.gif'):
- - options.mimeType = "image/gif"
- + options.mimeType = "image/gif"
- options.fileName = "tootyFruity_image.gif"
- options.chunkedMode = false;
- break;
- default:
- - return null;
- + return null;
- }
- options.headers = {'Authorization' : 'Bearer '+ this.currentAccount.accessToken}
- console.log(fileURL);
- @@ -168,7 +168,7 @@ export class APIProvider {
- // console.log(JSON.stringify(this.mediaUploadsProgress))
- // }
- // })
- - return this.fileTransfer.upload(fileURL, this.currentAccount.instanceUrl + "/api/v1/media", uploadOptions);
- + return fileTransfer.upload(fileURL, this.currentAccount.instanceUrl + "/api/v1/media", uploadOptions);
- }
- getTimeline(type: string, max_id?: string, since_id?: string): Observable<Response> {
- @@ -192,7 +192,7 @@ export class APIProvider {
- postToot(newToot:TootForm): Observable<Response>{
- let body = {'status': newToot.status,
- 'visibility': newToot.visibility};
- -
- +
- if(newToot.in_reply_to_id != null){
- body['in_reply_to_id'] = newToot.in_reply_to_id;
- }
- @@ -206,7 +206,7 @@ export class APIProvider {
- }
- body['media_ids'] = newToot.media_ids;
- }
- - return this.postRequest('/api/v1/statuses',body);
- + return this.postRequest('/api/v1/statuses',body);
- }
- @@ -247,7 +247,7 @@ export class APIProvider {
- private postRequest(apiUrl:string, body:any): Observable<Response>{
- let requestOptions = this.finalizeRequestOptions();
- return this.http.post(this.currentAccount.instanceUrl + apiUrl, body, requestOptions);
- - }
- + }
- preAuthPost(api_url: string, body: any): Observable<any>{
- let contentTypeHeaders = new Headers(['Content-type', 'application/json'])
- @@ -255,10 +255,10 @@ export class APIProvider {
- console.log(api_url)
- return this.http.post(api_url, body, request)
- .map(this.extractData)
- - .catch(err => {
- + .catch(err => {
- console.log(JSON.stringify(err));
- return Observable.throw(err); // observable needs to be returned or exception raised
- - })
- + })
- }
- private finalizeRequestOptions(requestOptions?: RequestOptionsArgs){
- @@ -277,5 +277,5 @@ export class APIProvider {
- if (body.data == undefined) return body
- else return body.data;
- }
- -
- +
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement