Aureliajs Waiting For Data On App Constructor
I am developing an app in aureliajs. The development process is started for many months and now, the back-end developers want to make their services versioned. So I have a web serv
Solution 1:
Aurelia provides many ways to handle asynchronous flow. If your custom element is a routed component, then you can leverage activate
lifecycle to return a promise and initialize the http service asynchronously.
Otherwise, you can use CompositionTransaction
to halt the process further, before you are done with initialization. You can see a preliminary example at https://tungphamblog.wordpress.com/2016/08/15/aurelia-customelement-async/
You can also leverage async nature of configure
function in bootstrapping an Aurelia application to do initialization there:
exportfunctionconfigure(aurelia) {
...
await aurelia.container.get(HttpServiceInitializer).initialize();
}
Post a Comment for "Aureliajs Waiting For Data On App Constructor"