Closed taianrj closed 5 years ago
If you are using library like axios
, then yes.
You can use axios intercepters.
BTW jQuery ajax do similar feature to intercept ajax calls.
Thank you for the fast answer. I'm trying to use jquery ajax interception to achieve it and I'm doing it to start and it's working, but it's creating many instances of the component (one overlaping the other).
Note: It's hapenning because I'm doing more than one ajax request at the same time.
How to avoid it?
$(function () { $.ajaxSetup({ beforeSend: function () { loader = self.$loading.show(); } }); });
You have to store instance in a variable, then hide the loader if instance exists, make a new instance, store it in same variable.
This a simple programming issue.
Thank you! Your component is amazing!
Hello, Ankur!
It's not a issue, just a question. Could you help me?
Is there an easy way to show your component everytime an ajax request is started and hide it everytime an ajax request is completed?