Questions tagged [ionic4]

Presentation

This tag is for questions specifically targetting version 4 of the Ionic Framework.

Ionic Framework is an open-source hybrid mobile application development framework that helps in building cross-platform mobile applications with standard Web technologies like , , and 's.

Ionic Framework is focused on giving a native-like UI experience, built on top of web technologies.

Traditionally, it has used Apache and . Since January 2019, Ionic 4 allows developers to choose multiple frameworks including , , , and web components.

Ionic also has a rich Command Line Interface which enables the developers to create, build, test and deploy applications.

Ionic 4 is built using which is a compiler that creates Web Components.

The Ionic Team are also developing an alternative to Cordova, called Capacitor. is a cross-platform app runtime that allows developers to build web apps that run natively on iOS, Android, Electron and the web.

Official Links:

5597 questions
27
votes
3 answers

How to not dismiss the alert box when clicking outside of it on Ionic

I am building a ionic 2 app and I am using the following component http://ionicframework.com/docs/components/#alert import { AlertController } from 'ionic-angular'; export class MyPage { constructor(public alertCtrl: AlertController) { } …
hopper
  • 4,230
  • 8
  • 36
  • 49
26
votes
8 answers

Custom Icons with Ionic 5?

I recently updated from Ionic 4 to Ionic 5. With Ionic 5 the icons received an update too. Apparently however also the mechanism loading the icons changed. In Ionic 4 it was possible to add custom icons like…
Chris
  • 4,238
  • 4
  • 28
  • 49
26
votes
2 answers

Ionic 4 - Pass Data BACK from Modal

I'm trying to create a modal window, pass it an array of objects, have a user select one object from that array, and then have my modal pass back the object they've selected. I've tried using the Ionic 2 approach of modalName.onDidDismiss(data=> …)…
MLynch
  • 425
  • 1
  • 4
  • 12
26
votes
13 answers

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

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…
anubhab
  • 730
  • 1
  • 7
  • 11
25
votes
16 answers

Ionic 4: how to hide ScrollBar in ion-content

I'm trying to hide the scroll-bar in ion-content (Ionic 4) there's no ion-scroll on ionic 4 so I used the ion-content but I can't find any css attribute to hide it (most of them not work) I do want to scroll but I don't want to see the…
Roishuk
  • 251
  • 1
  • 3
  • 4
24
votes
2 answers

module declares component locally, but it is not exported

i have created a shared module and declared & exported the component i need in other modules. import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { DateslideComponent } from…
earlyBirdDev
  • 383
  • 1
  • 2
  • 6
23
votes
5 answers

Ionic 4 Angular - How to self dismiss a modal

In Ionic 3, dismissing a modal was pretty simple: constructor(viewCtrl: ViewController) { this.viewCtrl.dismiss() } In Ionic 4, I can't import ViewController (or to be accurate, my IDE tries to import a type of ViewController). I was wondering…
Eliya Cohen
  • 10,716
  • 13
  • 59
  • 116
23
votes
6 answers

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

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…
Han Che
  • 8,239
  • 19
  • 70
  • 116
22
votes
6 answers
21
votes
2 answers

Dismiss Ionic 4 popover from its component

I have a standard Ionic 4 page (Home) that creates a popover that uses a component (BusinessDetails) with a button that redirects to a new page (RequestTurn). However, when I click on that button, the popover is not dismissed and is renders on top…
hugonne
  • 311
  • 2
  • 3
  • 9
21
votes
6 answers

how we can get the current page from app.component in ionic 4?

i am trying to get current page instance in app.component in ionic 4. in ionic 3 i can do it like this this.nav.getActive().instance
tanveer ahmad dar
  • 3,312
  • 1
  • 27
  • 29
21
votes
4 answers

Ionic 4 ion-title in toolbar is not centered on android

I am wondering if this a common problem. My ion-title is not centered in the toolbar on android. I googled it but I couldn't find anything for ionic 4, what I did found was a pretty good solution in ionic 3. here it is:…
Sireini
  • 4,142
  • 12
  • 52
  • 91
21
votes
5 answers

Ionic 4 : ngOnInit vs ionViewWillEnter

Which is better to use Angular Lifecycle Hook or Ionic Lifecycle hooks specially for initialization when creating a hybrid app using Ionic 4? Angular lifecycle hook - ngOnInit ngOnInit() { this.getData(); } Ionic lifecycle hook -…
Varun Sukheja
  • 6,170
  • 5
  • 51
  • 93
21
votes
5 answers

Ionic 4 setRoot with Angular Router

I'm upgrading my Ionic 3 project to the latest Ionic 4 and I have some trouble with Routing. In Ionic 3 I used setRoot just like this: handler: () => navCtrl.parent.parent.setRoot(HomePage, 'logout', {animate: true}) The latest navCtrl of Ionic 4…
Riccardo
  • 233
  • 1
  • 3
  • 8
20
votes
9 answers

Why is the ion-back-button not shown?

The ion-back-button does NOT show up to the right of the ion-menu-button. Why is that? the ion-menu-button and the ion-title show properly and aligned on the same horizantal position.
feder
  • 1,849
  • 2
  • 25
  • 43