ionic4

Component within page not animating on navigate for iOS

孤街浪徒 提交于 2019-12-01 12:19:18
问题 When navigating to a new screen by calling NavController.navigateForward('/url') you get a free native animation which slides the screen in to view. This works as expected unless I use a component within a page component. When I do that, everything animates as expected except the component within the page. When the following page is navigated to the content and title all slide into view as expected. <ion-header> <h1>The Title</h1> </ion-header> <ion-content> Some content... </ion-content>

Cannot find namespace 'ctx' error when creating Context with react - typescript

笑着哭i 提交于 2019-12-01 01:47:12
问题 I'm working on a project with react using typescript and I'm having a bad time figuring out why this error is happening, basically, I can't use any createContext examples that I found on the internet because of this. This one specifically I got from here: https://github.com/typescript-cheatsheets/react-typescript-cheatsheet I'm trying to use the same that is showing in the Context section. import * as React from "react"; export function createCtx<A>(defaultValue: A) { type UpdateType = React

Ionic 4 alternative for platform.registerBackButtonAction

♀尐吖头ヾ 提交于 2019-11-30 22:01:21
I looked around the new platform for the Ionic 4, it seems like the registerBackButtonAction function was removed from it. Are there any other alternatives to handle the Android hardware back button? Update: This was fixed in dfac9dc Related: how to integrate hardware back button into ionic4 navigation This is tracked on GitHub , in the Ionic Forums and Twitter Until there is an official fix, you can use this workaround: this.platform.backButton.subscribe(() => { // code that is executed when the user pressed the back button }) // To prevent interference with ionic's own backbutton handling //

How to set default login page and after login open tabs in ionic-4

我们两清 提交于 2019-11-30 19:53:56
问题 I am creating ionic tabs project and I want to set in default login page then after open tabs . I am set in default login page but after login i am not getting tabs in ionic 4. Please help me how to resolve this problem....? tabs.router.module.ts import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { TabsPage } from './tabs.page'; const routes: Routes = [ { path: 'tabs', component: TabsPage, children: [ { path: 'tab1', children: [ { path: ''

ngOnInit vs ionViewDidLoad in ionic 2 or ionic 2+

六眼飞鱼酱① 提交于 2019-11-30 05:52:25
Which one will I use for initializing data and why? ngOnInit() { this.type = 'category'; this.getData(); this.setData(); } ionViewDidLoad() { this.type = 'category'; this.getData(); this.setData(); } ngOnInit is a life cycle hook called by Angular2 to indicate that Angular is done creating the component. ionViewDidLoad is related to the Ionic's NavController lifeCycle events. It runs when the page has loaded. This event only happens once per page being created. Basically both are good places for initializing the component's data. But for using ngOnInit you need to implement the Angular's

Ionic 4 alternative for platform.registerBackButtonAction

风格不统一 提交于 2019-11-30 05:32:54
问题 I looked around the new platform for the Ionic 4, it seems like the registerBackButtonAction function was removed from it. Are there any other alternatives to handle the Android hardware back button? 回答1: Update: This was fixed in dfac9dc Related: how to integrate hardware back button into ionic4 navigation This is tracked on GitHub, in the Ionic Forums and Twitter Until there is an official fix, you can use this workaround: this.platform.backButton.subscribe(() => { // code that is executed

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

非 Y 不嫁゛ 提交于 2019-11-30 04:59:34
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: any; constructor(public loadingController: LoadingController, private customerService: CustomerService)

How to set background color IONIC 4

元气小坏坏 提交于 2019-11-30 04:50:14
I having problems trying to change the background color in just one IONIC 4 (--type=angular) page. I am trying to add a class for the ion-content. In my html file I Have: <ion-content class="fondologin"> ... </ion-content> In my sass I have: .fondologin{ background-color: #111D12!important; } The background color is never changed. If I add --ion-background-color:#111D12; in variables.scss the background is successfully changed for every page but I just one to change the color in one page. How can I achieve this? Kevin Sanchez For some reason I solved it this way: First of all I added --ion

Ionic 4 - how to pass data between pages using navCtrl or Router service

寵の児 提交于 2019-11-29 13:38:00
问题 In Ionic 3 you could use the second argument of the navController to pass data to the next page and retrieve it with the navParams service. This was a really convenient feature. Is there an equivalent api for routing in Ionic 4? You can always JSON.stringify the object/array to the routerParams, which in my opinion is less convenient. In Ionic 4 you can pass data with the modalController using ComponentProps and @Input() making it more suitable of a quick push/pop implementation. EDIT My

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

落爺英雄遲暮 提交于 2019-11-29 10:00:21
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> Try this, <button ion-button color="primary">Primary</button> In order to avoid that error message: Import CUSTOM_ELEMENTS_SCHEMA into app.modules