ionic3

IONIC 3 - I want to get file path of the pdf when select from file manager

可紊 提交于 2019-12-08 02:56:20
问题 Here i am posting my code of selecting PDF from file manager. i need to get file path of selected PDF. how can i get it? .html <input type="file" (change)="selectPDF($event)" class="file-input upload-items" name='company_pdf' style="opacity: 0" id="company_pdf" #fileInp> .ts selectPDF(fileInput: any) { if (fileInput.target.files[0].type == 'application/pdf') { console.log(fileInput.target.files) this.PDFfiles.push(fileInput.target.files[0]); if (this.PDFfiles.length > 4) { this

How to handle fcm background notification without tapping on it in ionic 3

好久不见. 提交于 2019-12-08 02:39:46
问题 i am using FCM in ionic 3. I am getting notification properly when the app is in foreground. When I receive a notification in background i am getting the data in the notification only after tapping the notification. But i want to get the data without tapping on the notification. For example see the below code. this.fcm.onNotification().subscribe(data => { if(data.wasTapped){ console.log("Received in background"); } else { console.log("Received in foreground"); }; }); Here i am getting data if

Input mask with thousand separator ionic 3

♀尐吖头ヾ 提交于 2019-12-08 02:29:14
问题 I need a thousand separator input mask directive or else with Ionic 3 app. I have tried 2 directives. But none of them were working. Do you know working directive for that? e.g. 50,000 .html <ion-input type="tel" [ngModel]="data?.budget" formControlName="budget" (ngModelChange)="data.budget=$event"></ion-input> I have logged issues on Git. please see that too: text-mask Issue ng2-currency-mask Issue 回答1: Here is my version of formatting that works on ionic too. Typescript: format(valString) {

Chrome' Cross-Origin Read Blocking (CORB) blocked cross-origin response' ionic

我怕爱的太早我们不能终老 提交于 2019-12-08 02:11:55
问题 i am trying to authenticate user but i am unable to call an Api due to the Cross-Origin Read Blocking (CORB) blocked issue my login.ts Code is if (this.plugins.isOnline()) { if (this.wait == true) { return; } else if (this.userLogin.email == '' || this.userLogin.password == '') { this.utility.doToast("Please don't leave any field blank."); return; } else { this.wait = true; this.auth.login(this.userLogin).subscribe((success) => { this.wait = false; console.log(success.successData); this

Correct way of defining a model in Ionic 3

ε祈祈猫儿з 提交于 2019-12-08 00:25:48
问题 What is the correct way of defining a model in Ionic 3 with getters and setters? I followed this. export class ItemModel{ private _name: string; constructor(private n: string){ this._name = n; } get name(): string { return this._name; } set name(name: string) { this._name = name; } } Is it correct? In some forums it was mentioned about a need to keep the code very short. So does that mean using getters and setters would affect the performance somehow? 回答1: Typescript supports accessors

Ionic 2 Cannot view span inside of ion-item, how to render simple text

杀马特。学长 韩版系。学妹 提交于 2019-12-07 23:58:19
问题 I'm not sure if I'm missing something, but when I try to add a span to a Ion Item the span is not rendered, nor div. <ion-card> <ion-card-title> </ion-card-title> <div> <button ion-button (click)="toggleEdit()">Edit</button> </div> <ion-list> <ion-card-content> <ion-item [hidden]="editOptions.!isEditing"> <span class="inline-edit">Text</span> <ion-label color="primary">{{label}}</ion-label> <ion-input></ion-input> <span class="inline-edit">{{value}} </span> </ion-item> <ion-item [hidden]="

How to store pdf file on Local Storage Root Directory in Ionic 2

断了今生、忘了曾经 提交于 2019-12-07 23:56:20
问题 I want to create pdf file using pdfmake and store this pdf on the local root storage directory. new folder should be parallel to other folders like android ,bluetooth. I have given folder list below. which method will work on this? I have tried some method of file native like-externalDataDirectory,dataDirectory from http://ionicframework.com/docs/native/file/ Internal Storage |- .IdeaDesktopHD |- .lelauncher |- .magic |- .powercenterhd |- Alarms |- Android |- Audio |- Bluetooth |- Contact |-

unrecognized selector sent to instance - Ionic cordova Google-plus login

风流意气都作罢 提交于 2019-12-07 23:42:31
Using "@ionic-native/google-plus": "^4.20.0" "cordova-plugin-googleplus": "^7.0.1" "cordova-plugin-cocoapod-support": "1.6.0" because using the Gogole plugin together with: "cordova-plugin-firebase": "git+ https://github.com/vash15/cordova-plugin-firebase.git#master ", When calling this.googlePlus.logout() or this.googlePlus.login(), this gives following errors: (logout) -[__NSCFString gtm_stringByUnescapingFromURLArgument]: unrecognized selector *** Terminating app due to uncaught exception 'NSInvalidArgumentException' (login) -[__NSDictionaryI gtm_httpArgumentsString]: unrecognized selector

HTML + Ionic 3.x: How to use a for loop in the html file using in instead of of

守給你的承諾、 提交于 2019-12-07 22:58:04
问题 I have several arrays of objects in my typescript file. I want to iterate through these arrays simultaneously and display their contents in the html file. Here is the content: <ion-item> {{array1[i]}} {{array2[i]}} {{array3[i]}} </ion-item> Luckily the arrays are always the same size. Now I want to do a for-loop after the ion-item (something like this): <ion-item *ngFor="let i in array1"> {{array1[i]}} {{array2[i]}} {{array3[i]}} </ion-item> But doing it this way gives me an error: "Can't

upload image ionic 3

两盒软妹~` 提交于 2019-12-07 22:29:54
问题 I am developing an app in ionic 3 and need to upload image to server using an api created in lumen framework. The request to upload image is : The image is clicked from camera and converted to base64. let base64Image = 'data:image/jpeg;base64,' + imageData; Then i use FileUpload to upload image import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer'; buildHeadersDeals(){ this.header = new Headers(); this.header.append('Authorization', 'Basic ' +btoa(