ionic3

Ionic 2 http.get() issue

半城伤御伤魂 提交于 2019-12-06 07:25:39
I tried to make a http.get() call with these two methods. First: getResults(){ return this.http.get('http://localhost/api.php') .toPromise() .then( data => data.json() ); } Error Shown: 3 122412 error EXCEPTION: Uncaught (in promise): Response with status:0 for URL: null 4 122413 error ORIGINAL STACKTRACE: 5 122413 error Error: Uncaught (in promise): Response with status: 0 for URL: null .......... Second: getResults(){ return new Promise((resolve, reject) => { this.http.get('http://localhost/api.php') .map(res => res.json()) .subscribe(data => { resolve(data); }, (err) => { reject(err); }); }

Ionic 3: Menutoggle keeps getting hidden

▼魔方 西西 提交于 2019-12-06 06:48:40
问题 I have implemented a hamburgermenu in Ionic 3, but I am facing an issue. When I run the application on my Android device the hamburgermenu keeps disappearing i.e. the button to open the side menu is gone. However, it only happens sometimes. I tried to run the application while inspecting it with Google Chrome, and what I noticed is that the menutoggle gets hidden for some reason, but I don't know why. I don't control the visibility in the .ts class. <ion-header> <div> <ion-navbar> <button ion

How to check if two fields are equal in Angular / Ionic?

社会主义新天地 提交于 2019-12-06 06:14:44
I am wanting to check if the values of two fields are the same, these fields must be passed by parameters to the validation function, I am doing this, the problem is that it can not get the value of the field, it appears null, as Can I get the values correctly and dynamically? My form builder, I'm using the match function to check the cell_phone and confirmation fields. this.recharge = this.formBuilder.group({ cell_phone: ['', Validators.required, Validations.match('cell_phone', 'cell_phone_confirmation')], cell_phone_confirmation: ['', [Validators.required]], value: ['', Validators.required],

How to use jquery in ionic 3

半腔热情 提交于 2019-12-06 05:48:47
问题 I'm trying to load external website in a div using jquery in ionic 3. TS: export class HomePage { constructor(public navCtrl: NavController) { $('#loadExternalURL').load('http://www.google.com'); } } HTML: <ion-content> <div id="loadExternalURL"></div> </ion-content> I'm getting blank screen on serving the ionic app. Is there anything I'm missing? Any Suggestion? 回答1: I did it in following way, Install Jquery module in your IONIC-3 app, npm install jquery --save Import JQuery in HomePage.ts

Cannot find namespace 'google' in ionic 3 app

时间秒杀一切 提交于 2019-12-06 05:40:41
can anyone help me with this error im getting in my ionic 3 application after my attempt to use google variable in my project, npm install --save @types/google-maps which added the following to my package.json: "@types/google-maps": "^3.2.0", i also did declare declare var google; and did typings install dt~google.maps --global then i seen this soultion and tried it but that did not work either (notice i generated an ios key and android key) tried this Cannot find namespace 'google' ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API

upload image ionic 3

不羁岁月 提交于 2019-12-06 05:20:39
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("test:test")); } uploadPhoto(image, token) { this.buildHeadersDeals(); url = 'http://192.168.2.12/api

Ngrx effects on lower version of typescript doesn't work

試著忘記壹切 提交于 2019-12-06 05:01:55
I have an Ionic 3 App where I use ngrx/store and ngrx/effects . But each time I try to run the app it sais this error below: TypeScript Error A computed property name in a type literal must directly refer to a built- in symbol. ...: Cannot find name 'any'. which refers to this folder in my node modules node_modules/@ngrx/effects/src/on_run_effect.d.ts to this block of code below: export declare function isOnRunEffects(sourceInstance: { [onRunEffectsKey]?: onRunEffectsFn; }): sourceInstance is OnRunEffects; This can be fix by installing higher version of typescript but as of now currently I am

showing Admob banner in Inappbrowser(ionic)

时光怂恿深爱的人放手 提交于 2019-12-06 04:48:38
问题 After some research, I get to know that I can place AdMob ads into an application which is having an Android Webivew. I can able to integrate Banner ads into the apk where the ad is appearing at the bottom as expected. But once the url loads in the app, I am not able to see the banner. I'd checked in this link (How to show AdMob banner in inappbrowser using Cordova/Ionic) but It is with AngularJS(1) framework, I am looking for the same with Angular(5). Any help will be appreciated! 来源: https:

Saving file to Downloads directory using Ionic 3

限于喜欢 提交于 2019-12-06 02:01:22
问题 i know this link: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/#where-to-store-files but i would like to save the file in Downloads directory. Is this possible to save the file in any path using Ionic? If so, please, share the example. Here's the code: downloadImage(image) { this.platform.ready().then(() => { const fileTransfer: TransferObject = this.transfer.create(); const imageLocation = `${cordova.file.applicationDirectory}www/assets/img/${image}`; fileTransfer

Ionic 3 - Update Observable with Asynchronous Data

你说的曾经没有我的故事 提交于 2019-12-06 01:35:43
问题 For a social media app, I have a collection of feed objects referenced by their IDs using AngularFire 2 . Once each of these IDs has its relevant data pulled from the database that stores the actual feed objects, I wish to update the feedCards Observable object with this information so I can asynchronously display a collection of feed objects in my HTML. It's a pretty confusing chain of events, so let me summarize it for you. Step-by-step Approach displayFeed() is invoked right before the