Answer the question
In order to leave comments, you need to log in
How do you do authorization in Angular 2?
I have a canActivate method that requests the user from the server. at the moment everything works, but there is one not very pleasant moment, while the application is loading, the base preloader is spinning, then a blank screen while waiting for the server response. How to make the preloader spin until the server response arrives?
<body>
<app-root>Loading...</app-root>
</body>
Answer the question
In order to leave comments, you need to log in
export class Login{
result:Array<Object>;
constructor(http: Http,private dd:dataService) {
this.dd.showLoader();
this.dd.fetchData().subscribe((result) =>{
this.result =result
},
(err)=>console.log(err),
()=>{console.log("Done")
this.dd.hideLoader();
});
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question