Skip to content

Commit

Permalink
spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigojap committed Feb 4, 2021
1 parent 0b2eab3 commit da6dd3c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
14 changes: 11 additions & 3 deletions VirtualMind.WebApp/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion VirtualMind.WebApp/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
"@ngrx/store": "^10.1.2",
"@nguniversal/module-map-ngfactory-loader": "8.1.1",
"aspnet-prerendering": "^3.0.1",
"bootstrap": "^4.3.1",
"bootstrap": "^4.6.0",
"core-js": "^3.3.3",
"jquery": "3.4.1",
"ng-bootstrap-spinner": "^1.2.0",
"oidc-client": "^1.9.1",
"popper.js": "^1.16.0",
"rxjs": "^6.5.3",
Expand Down
2 changes: 2 additions & 0 deletions VirtualMind.WebApp/ClientApp/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { RouterModule } from '@angular/router';
import { NgSpinnerModule } from 'ng-bootstrap-spinner';

import { AppComponent } from './app.component';
import { NavMenuComponent } from './nav-menu/nav-menu.component';
Expand All @@ -19,6 +20,7 @@ import { QuoteReducer } from './store/quote/quoteReducer';
],
imports: [
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
NgSpinnerModule,
HttpClientModule,
FormsModule,
RouterModule.forRoot([
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<h1 id="tableLabel">Quotes</h1>

<div *ngIf="loading">
<ng-spinner size="5" type="border" color="warning"></ng-spinner>
</div>

<p> Look the quotation of the day</p>

<div *ngIf="dolar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class FetchDataComponent {
quote$: Observable<QuoteState>;
dolar: quote;
real: quote;
loading: boolean;

constructor(private http: HttpClient,
@Inject('BASE_URL') private baseUrl: string,
Expand All @@ -36,8 +37,14 @@ export class FetchDataComponent {

getAllQuote() {
console.log('fetching cote');
this.loading = true;
this.getDollarQuote();
this.getRealQuote();
this.getRealQuote();

//to see the spinner
setTimeout(() => {
this.loading = false;
}, 2000);
}

getDollarQuote() {
Expand Down

0 comments on commit da6dd3c

Please sign in to comment.