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
108
votes
1 answer

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

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…
Victor Carvalho
  • 1,610
  • 3
  • 14
  • 18
62
votes
14 answers

How to set background color IONIC 4

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: ... In my sass I…
Kevin Sanchez
  • 2,215
  • 2
  • 11
  • 19
52
votes
9 answers

how to check app running in foreground or background in ionic/cordova/phonegap

Is there any way to check whether the app is running in foreground or background in ionic/cordova/phonegap, I need to use it on android and ios, thanks a lot
user1521398
  • 523
  • 1
  • 4
  • 7
41
votes
5 answers

Ionic 5 - How to replace default icon and splash screen image and generate resources

I recently started using ionic 6 and capacitor(not cordova), and I don't know how to replace its default application icon and splash screen. Is there any way to do it and generate resources using ionic capacitor cli like what we were doing with…
Jalaleddin Hosseini
  • 2,142
  • 2
  • 25
  • 28
41
votes
8 answers

Ionic 5 with Angular 9 - Angular JIT compilation failed: '@angular/compiler' not loaded

Ionic 5 was announced a few hours ago (12th Feb 2020) and I upgraded my one of the small production app to Ionic 5 along with Angular 9: # To update to Ionic 5 npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save-exact --save # To…
Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
39
votes
8 answers

Ionic 4 custom components

How do you load a component in ionic 4 after running the command ionic g component myComponent? I want to add a new generated custom component to my home page.
Yushin
  • 1,684
  • 3
  • 20
  • 36
38
votes
23 answers

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

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…
rami bin tahin
  • 1,897
  • 2
  • 10
  • 16
37
votes
2 answers

Could not find cordova integration in the default project

following the official getting started tutorial I get the following error when I try to deploy the application in my phone using this command: ionic serve --devapp (it works on browser): [ERROR] Could not find cordova integration in the default…
user3471528
  • 3,013
  • 6
  • 36
  • 60
37
votes
5 answers

ionic 4: changing ion-content background does not work

i have tried in global.scss as ion-content{ background-image: url('assets/images/cover.jpg'); -webkit-background-image: url('assets/images/cover.jpg'); background-repeat: no-repeat; background-size:cover; } but this does not…
Vik
  • 8,721
  • 27
  • 83
  • 168
36
votes
3 answers

Render HTML content in Ionic 3/4/5

view.html
{{text}}
The question is that 'text' has HTML that I wish to be displayed as it should but it only shows the HTML tags and text. What can I do to render such content? I've tried the earlier version (Ionic 1/2) solutions and…
sam_v
  • 494
  • 1
  • 5
  • 12
35
votes
9 answers

NavController doesn't work in Ionic 4

I'm injecting NavController in my constructor as I want to push a page. But, below code doesn't work in Ionic 4. It was totally okay in Ionic 3. Constructor constructor(public menuCtrl: MenuController, public navCtrl: NavController) { …
30
votes
3 answers

ngOnInit vs ionViewDidLoad in ionic 2 or ionic 2+

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(); }
saif
  • 487
  • 1
  • 7
  • 19
29
votes
8 answers

How do I install new fonts in Ionic 4?

Does anyone know how to update the font for Ionic 4? I tried adding the aileron.woff to assets/fonts and putting this in the variables.scss to no avail. src: url('../assets/fonts/aileron.woff') format('woff');
Troy Thompson II
  • 421
  • 1
  • 6
  • 12
28
votes
4 answers

How do you update the iOS & Android app version in Ionic w/ Capacitor?

I am developing an app using Ionic and Capacitor. Builds are generated using Ionic's new AppFlow service, so I don't build them locally. How do I go about updating the iOS and Android version numbers? I've tried updating the plist and config.xml,…
Bryant Makes Programs
  • 1,493
  • 2
  • 17
  • 39
27
votes
3 answers

Get value from input in Ionic 4 alert

As of today the Ionic 4 documentation on ion-alert contains an example how to add a text input to an alert, like this: const alert = await this.alertController.create({ inputs: [ { name: 'name1', type: 'text' }, But I can not…
Andi
  • 3,234
  • 4
  • 32
  • 37
1
2 3
99 100