Hi I'm new on Ionic and I have this error when I want create new loadingScreen.
Argument of type '{ content: string; }' is not assignable to parameter
of type 'LoadingOptions'.
Object literal may only specify known properties, and 'content' does not exist in type 'LoadingOptions'.
I see documentation and I think the syntax is good.
const loading = await this.loadingController.create({
content: 'Please wait...',
});
await loading.present();
Looks like their docs are outdated, here is the interface definition in their code:
https://github.com/ionic-team/ionic/blob/master/core/src/components/loading/loading-interface.ts
export interface LoadingOptions {
spinner?: SpinnerTypes | null;
message?: string;
cssClass?: string | string[];
showBackdrop?: boolean;
duration?: number;
translucent?: boolean;
animated?: boolean;
mode?: Mode;
keyboardClose?: boolean;
id?: string;
enterAnimation?: AnimationBuilder;
leaveAnimation?: AnimationBuilder;
}
As you can see, there is no content anymore, it has been renamed to message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With