Created
December 12, 2018 18:54
-
-
Save LucasJorgeHubert/b5ab31a9070532fdf4309a1698427ee0 to your computer and use it in GitHub Desktop.
Loading Angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgxLoadingModule, ngxLoadingAnimationTypes } from 'ngx-loading'; | |
NgxLoadingModule.forRoot({ | |
animationType: ngxLoadingAnimationTypes.pulse, // Aqui voce decide o estilo do loading ([ctrl]+[space]) | |
backdropBackgroundColour: 'rgba(0,0,0,0.1)', | |
backdropBorderRadius: '4px', | |
primaryColour: '#008e57', | |
secondaryColour: '#008e57', | |
tertiaryColour: '#008e57' | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ngx-loading [show]="loading" [config]="{ backdropBorderRadius: '3px' }" [template]="customLoadingTemplate"></ngx-loading> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class indexComponent { | |
// Inicia o Loading como falso | |
public loading = false; | |
// Função para chamada da API setando o Loading como | |
// true antes de iniciar a request, e setando | |
// como falso assim que recebe a resposta | |
searchPerDate() { | |
this.loading = true; | |
this.indexeService.indexFunction( | |
).subscribe(list => (this.indexList = list, this.loading = false)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment