Topic: There is no enough information about how to use "Preloading script"
Damian Gemza staff answered 7 years ago
<div class="spinning-preloader-container"> <div class="preloader-wrapper big active"> <div class="spinner-layer spinner-blue-only"> <div class="circle-clipper left"> <div class="circle"></div> </div> <div class="gap-patch"> <div class="circle"></div> </div> </div> </div> </div>
<app-root></app-root>
import { Component, OnInit } from '@angular/core'; import { MDBSpinningPreloader } from 'app/typescripts/pro'; @Component({ selector:'app-root', templateUrl:'app.component.html', styleUrls: ['app.component.css'] }) export class AppComponent implements OnInit { constructor(privatemdbSpinningPreloader:MDBSpinningPreloader) {} ngOnInit() { setTimeout(() => { this.mdbSpinningPreloader.stop(); }, 5000) } }
Arsenii pro commented 7 years ago
Hello Damian, Thank you, the spinner works now. Please improve documentation of preloading script section for others to undertand this better too. The code itself looks very unrelated so I think I'm not the only one who can have problems in understanding where to put it and how to use (frankly speaking, I still don't understand the mentioned "primary color" class and how I can have white spinner as in example). Also I was very surprised to see possibility to create only four types of spinners. It would be better to have possibility to create spinners of all colors you provide for buttons (for example, I used elegant color scheme for one project and deep-purple for the other one, so for both these four spinners look not very related). Best Regards, ArseniiDamian Gemza staff commented 7 years ago
Dear Arsenii, About creating white spinner: Here's some workaround for this: https://mdbootstrap.com/support/customize-spinner-color/. Of course, we'll improve our preloader docs to put there more information how to use our preloaders in a live project. Also in future, we've got plans to improve our preloaders to give users a possibility to provide or custom color, or at least colors from our palette. Best Regards, DamianFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Damian Gemza staff commented 7 years ago
Dear Arsenii, Few minutes ago I was trying to add preloading scripts, and for me, everything was okay. Add to your app.componen.ts preloader service and in onInit use stop() method from MDBSpinningPreloader service, and then in your index.html add preloader html markup. Best Regards, DamianArsenii pro commented 7 years ago
Dear Damian, please look into index.html code of Preloader script section. Unfortunately I have no idea how it can be realated to one white preloader (because it has four colored preloaders) and where should it be put in my index.html. I've tried a few variants (where to put it in real index.html) usring particulary that code and haven't seen any preloader on start. Regards, Arsenii