i very unhappy with the LoadingController.
Can someone add best practice for the LoadingController?
in the ionic-conference-app is no LoadingController.
My Problem is the Loading Controller dismiss function, this function is not working on my Project.
And can i add a global loading function an call them like:
yes… this happens because of change detectors of angular.
I haven’t not much knowledge about this… ask to superior who have great knowledge about zone, change-detectors, etc
A temporary workaround is.
create loading object every time you want in your different methods and use present and dismiss in the same methods. Do not create it in a constructor.
But for me, I don’t want to create it multiple times, I want to follow above posted approach. I trying to find the solution upon it.
Let me know if you have find any solution on this.
because this.loading had dismissed. if u wanna use it repeated, u can only do like this
constructor(xxxxxx){}
yourmethod(){
let loader = loadingController({content…});
loader.present();
this.someService.someMethod().subscribe(res=>{
loader.dismiss();
//dosth
},err=>{
loader.dismiss();
//dosth
})
}
it’s terrible to define it in every remote api method.
I like it when my build tools tell me when I make stupid mistakes. I also like it when object lifecycle is localized, because it means I can quickly zero in on the only possible place a bug can be living.
The design in the previous post flies directly in the face of all of this. Neither the programmer nor any static code analysis tool I’ve seen has any idea how to prevent or identify the cause of double-dispose or reuse bugs that will fatally torpedo your app at runtime.
I recommend always making LoadingControllers lexically scoped, and never storing them in controller properties.