typescript - How to implement a loading spinner on content change with the ASP.NET Core Angular SPA template? -


i setup toy project based on angular template asp.net core 2.0 in order create spa testing purposes:

i know server pre-rendering process making things lot faster spa in case of latency.

but still how achieve this? can automatized (like applicable views when coded on client side (!*.cshtml)) ?

thanks

if want spinner on route changes, can set flag part of router events:

checkrouterevent(routerevent: event): void {     if (routerevent instanceof navigationstart) {         this.loading = true;     }      if (routerevent instanceof navigationend ||         routerevent instanceof navigationcancel ||         routerevent instanceof navigationerror) {         this.loading = false;     } } 

then turn on/off spinner based on flag.

in html:

<span class="glyphicon glyphicon-refresh glyphicon-spin spinner" *ngif="loading"></span> 

i have working example set here: https://github.com/deborahk/angular-routing (in apm-final folder).


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -