Developer-console is your friend…
Checkout your http-request and response and it tells you more details about the error…
Ionic 4 - XMLHttpRequest throw error
Ion-list is not supported on ios devices in Ionic 4
Hi! Thanks for the reply! The other items it the component are shown perfectly. Also other components that have other ui components work. The ion-list is not showing. The only thing that prints is only one list but empty. As you can see in my code, I have an iteration where I show in each list the day property.
It does now work on ios emulator. only in android and in browser.
Ion-content is not a known element
That’s a great question, and the best answer I have to it at the moment is "totally ignore all the lazy-loading stuff and put everything in a single AppModule
".
Ionic 4 - XMLHttpRequest throw error
This code runs successfully in the browser. Also some devices which apk uploaded, runs codes without any error but device like Huawei p30 (also it is our test device) has this stuation
Ionic 4 - XMLHttpRequest throw error
Sorry I’m new in mobile development on Ionic…
But for me you have to find what is causing the problem…client or server.
In that case you have to trace your response/request with your native IDE to find it out.
In your case XCode.
Your code is too less information to find out what’s the problem could be.
IONIC 4 : Loading Controller, dismiss() is called before present() which will keep spinner without dismissing
I found a new way to do this. I hope it help!
It’s using the id of loading. So if you have many loadings you don’t want to dismiss wrong loading.
In the service:
async showLoading(loadingId: string, loadingMessage: string = 'Loading...') {
const loading = await this.loadingCtrl.create({
id: loadingId,
message: loadingMessage,
spinner: 'circles'
});
return await loading.present();
}
async dismissLoader(loadingId: string) {
return await this.loadingCtrl.dismiss(null, null, loadingId).then(() => console.log('loading dismissed'));
}
In the component calling the loading:
await this.globalVars.showLoading('ifOfLoading')
Dismissing the loading:
this.globalVars.dismissLoader('ifOfLoading')
Ion-content is not a known element
Thank you. I thought that not using --spec=false was solving the problem but its not. It’s that I had commented out the component in the routing section. So basically the error continues: “ion-content is not a known element”.
Ion-list is not supported on ios devices in Ionic 4
Try to cut things out, which might cause a problem to get closer to the problem
Maybe the ion-list is not the real problem…
For example…
Comment everything out within your ion-list and insert on hardcoded ion-item.
Check it again on you device to find out whether you code within the ion-list makes trouble or something else.
Ion-list is not supported on ios devices in Ionic 4
I just did it.
<ion-list *ngFor="let day of newArray">
<ion-item>
<div>
{{my_days}}
</div>
</ion-item>
</ion-list>
The problem is with *ngFor.(only in ios) I have other *ngFor and are working perfectly.
I tried now with another array inside ngFor and it does now work although it works in the other component on ios device. On ios device ion-list with ngFor have some issue together.?
Diagnostic not working
@theetje What version of diagnostic are you running for your Ionic 3 App? I have installed the latest version and it doesn’t work on Android emulator, the version I have needs “/ngx” on the end when importing it and I have had issues before with “/ngx” versions of plugins showing a similar error, I am struggling to find which version is the latest one that is not “/ngx”
[best practice] Chained API requests
Any time I have nested futures, I’m uncomfortable.
“Need”? No, but that’s definitely where I would do this task. The rest of this post, however, assumes that we’re still doing everything client-side.
That depends on who can share what. If everything is 1-to-1, meaning that each user has exactly one address, one phone number, and no users can share any of those things, then I don’t see the point in having them in separate tables. We’re still going to leave that alone, and address how to do this most cleanly in RxJS.
Some heuristics I use here:
- no
any
- everything is functional, no external state (this means that inside
getPosts
,this
is read-only) - no nested subscriptions
- no subscribing in the place we generate the future (meaning no
subscribe
in our service at all)
The basic technique for flattening your structure is outlined in this post.
Ion-list is not supported on ios devices in Ionic 4
I think of programming as partly a bunch of contract negotiations, and the contract of ngFor
is “thou shalt always feed me something iterable” (and that means you have to initialize newArray
- not a great name, btw - at construction time). Similarly, if you’re going to write template expressions like weatherForecast[day][0].minTemp
, you are implicitly promising that at all times (i.e. not just after some remote API call has resolved or some random lifecycle event has fired), weatherForecast
is always an array, as is whatever weatherForecast[day]
is, and it must have at least one member, which is an object. So be very defensive in how you initialize every property in your controller that is referenced by the template.
Diagnostic not working
I don’t think it’s a good idea to look backwards like this. Instead, ensure that all your @ionic-native/*
dependencies share the same (current) major version.
Ionic 4 - XMLHttpRequest throw error
Make sure your endpoint is https, not http.
Incidentally, why aren’t you using Angular’s HttpClient
instead of micromanaging all this XHR stuff?
I’m also nervous about the hardcoded admin usernames and the possibility that you’re relying on that for security.
Diagnostic not working
@rapropos Can you confirm that the “current” versions of the plugins (the ones that require “/ngx”) work on Ionic 3 though, everytime I have tried them I always get the same error as follows:
Object(...) is not a function
Diagnostic not working
Not directly, but I can tell you that:
…is caused by not doing this:
Ion-list is not supported on ios devices in Ionic 4
Okay. Sorry for the naming. As for the other things, I will always display smt as in the ngOnInit() of the component I am subscribing to the appropriate methods that I need to get the values and to show then in the component view.
I am having exactly this array:
array = [“Thursday”, “Friday”, “Saturday”, “Sunday”, “Monday”, “Tuesday”];
And the *ngFor on ios does not print this array. What is the problem?
How to trigger an event when a certain slide is active?
<ion-slides>
has a zillion events. I would start by listening to ionSlideDidChange
, seeing if we’re on slide 3, and then going to town.
Diagnostic not working
@rapropos Okay, so the issue is that I have a mixture of version 4 and version 5 of the plugins in my App? If this is the case I will bear this in mind for when I do decide to update them that I must update all of them at the same time to the latest version, unfortunately where this is a production App I haven’t got the time or resources at the moment to upgrade them all and test everything is working because I need to get a new version of the App released in the knowledge that I am not going to be breaking anything for my customers.
I can confirm that I have resolved the problem by downgrading the diagnostic plugin to version 4 by running the following:
ionic cordova plugin rm cordova.plugins.diagnostic
npm rm @ionic-native/diagnostic
ionic cordova plugin add cordova.plugins.diagnostic@4
npm install @ionic-native/diagnostic@4
Ion-list is not supported on ios devices in Ionic 4
This is precisely what I was warning about when saying:
You must initialize everything being referenced by the template at construction time. That means in the constructor, or, if possible, a much better option for readability IMHO is to do it at declaration time:
foos: Foo[] = [];
Not in ngOnInit
. Not in ionViewWillEnter
. Definitely not in a subscription to an Observable
made in either of those that will resolve in the future.