ionic4

Ionic 4: “Loading Controller” dismiss() is called before present() which will keep spinner without dismissing

拈花ヽ惹草 提交于 2019-12-18 10:54:39
问题 I used "Ionic Loading Controller" to show a spinner until the data is retrieved then it calls "dismiss()" to dismissed it. it works fine, but sometimes when the app already have the data, the "dismiss()" is called before the "create()" and "present()" is done which will keep the spinner without dismissing... I tried to call the data inside "loadingController.present().then()", but that caused the data to be slower... is this a bug? how to solve the this issue? Example of my code: customer:

IONIC4 : how to use cssClass for Loading , it is doesn't work

只谈情不闲聊 提交于 2019-12-18 09:48:09
问题 I want to change ion-loading style using cssClass ,my code as follow: loading.page.ts : @Component({ selector: 'app-loading', templateUrl: './loading.page.html', styleUrls: ['./loading.page.scss'], }) export class LoadingPage { constructor(public lLoadingController: LoadingController) { } async presentCunstomLoading() { const loading = await this.lLoadingController.create({ spinner: 'hide', duration: 500000, content: 'Please wait...', translucent: true, cssClass: 'custom-class' }); return

Ionic button showing 'ion-button' is not a known element

前提是你 提交于 2019-12-18 05:45:22
问题 I am new to ionic, it seems like a silly question but I need some help Using some simple button is throwing error. I am using ionic 4.0. 'ion-button' is not a known element: 1. If 'ion-button' is an Angular component, then verify that it is part of this module. 2. If 'ion-button' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. <ion-button color="primary">Primary</ion-button> 回答1: Try this, <button ion-button color=

Handling hardware back button in Ionic3 Vs Ionic4

懵懂的女人 提交于 2019-12-17 15:44:47
问题 Please find the below code for the Android hardware back button action in ionic3 . As Ionic4 uses angular routing for navigation how the pop event will take place for the back button? If we want to pop to the last page we can use the following code this.navCtrl.goBack('/products'); . But how we can use it for the android hardware back button action in ionic4 ? Ionic3 hardware back button action this.platform.registerBackButtonAction(() => { let activePortal = this.ionicApp._loadingPortal

disable menu on login page ionic 4

百般思念 提交于 2019-12-14 00:15:40
问题 I use the beta of ionic 4 for the first time. I try to disable the menu on a login page, but i have some trouble. I've created the app with ionic-cli and the sidemenu template, then I generated a login page. I removed the <ion-split-pane> from the app.component.html I modified the app-routing.module.ts to redirect to my login screen. In my login file, I tried to put an ngOnInit event to disable the menu on this specific page import { Component, OnInit, AfterContentInit, AfterViewInit

Getting Blank screen after importing and using WooCommerce API

╄→гoц情女王★ 提交于 2019-12-13 19:12:31
问题 I'm trying to use WooCommerce API in Ionic4 application after importing API in my home page I cannot see anything on output screen below is code: home.page.ts import { Component } from '@angular/core'; import * as WC from '@woocommerce/woocommerce-rest-api'; @Component({ selector: 'app-home', templateUrl: 'home.page.html', styleUrls: ['home.page.scss'], }) export class HomePage { //Local Objet WooCommerce of type any WooCommerce: any; constructor() { this.WooCommerce = WC({ url: "https://shop

The pipe 'translate' could not be found error is showing In Ionic 4

微笑、不失礼 提交于 2019-12-13 18:41:16
问题 I am working in my Ionic 4 App and I have installed the ngx-translate plugin. It is working fine in app.component.html but in tabs.page.html it is showing the error. The pipe 'translate' could not be found This is my app.component.html : <ion-list class="mylist22" color="myheader"> <ion-item color="myheader"> <ion-label>Gender</ion-label> <ion-select [(ngModel)]="languageSelected" (ionChange)='setLanguage()'> <ion-select-option value="en" selected>English</ion-select-option> <ion-select

Ionic 4 with Tesseract offline getting “Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope'”

给你一囗甜甜゛ 提交于 2019-12-13 04:11:50
问题 I am trying to use Tesseract in offline mode in my Ionic 4 app. In order to do it I have based my code on what is explained in this example, although it is done with Ionic 3 and what the Tesseract GitHub explains regarding offline mode. First, I have put the Tesseract files in the src\assets\lib directory as follows (the tesseract- prefix for the files has been added by me): Next I created a service that basically creates a Tesseract offline mode instance as indicated in the above mentioned

Ionic 4 - Native camera plugin issues

时间秒杀一切 提交于 2019-12-13 03:49:51
问题 I have developed an android application using Ionic4. I am facing some issues with Ionic Native Camera plugin. The following is my code. The issues that i am facing is given below. The version if camera plugin i am using is "@ionic-native/camera": "^5.3.0", . Issues Gallery is not opening Captured image is not returning. Application crashes after taking picture html <img [src]="studentImage!==null ? studentImage: 'assets/icon/ic_avatar.png'" class="add-picture" (click)="addImage()"> .ts

Ionic 4 Angular 7 - HTTPClient.post() is not returning any response

夙愿已清 提交于 2019-12-13 03:46:33
问题 I am trying to do a HTTPClient.post() to a web service but I am receiving no response. I tried executing the service call through post man and I am receiving a response. I have tried enabling and disabling CORS but there is no difference. Below is my service.ts authentication.service.ts import { Platform } from '@ionic/angular'; import { Injectable } from '@angular/core'; import { Storage } from '@ionic/storage'; import { BehaviorSubject } from 'rxjs'; import { HttpClient, HttpHeaders,