We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So, Im creating a carousel with data from the backend, I populate its array in the constructor function: this is my component.ts:
export class HomeComponent implements OnInit { rodeos = []; @ViewChild('carousel') carouselElement; showInitialized = false; actions = new EventEmitter<string>(); constructor(private elementRef: ElementRef, private authService: AuthService, private rodeoService: RodeosService) { } ngOnInit() { this.rodeoService.getRodeoList().subscribe( data=>{ this.rodeos = data; } ) } isLoggedIn(){ return this.authService.isLoggedIn(); } }
My html is like this:
<div #carousel class="carousel" [ngClass]="{ 'initialized': showInitialized }" materialize="carousel"> <div *ngFor="let rodeo of rodeos" class="carousel-item"> <!--<div class=''>--> <div class="rodeio-card"> <div class="card"> <div class="card-image"> <!--Id do rodeio--> <a [routerLink]="['/rodeio/1/info']"><img src="../../../assets/images/banner.png" class="img-responsive"></a> </div> <div class="card-content"> <h5><b></b></h5> <div class="row"> <div class="col s6"> <div class="infos"> <img src="../../../assets/images/icon_calendario.png" class="img-responsive"> <h4>Data de Início</h4> <h5><b>20/10/2018</b></h5> </div> <div class="infos"> <img src="../../../assets/images/ico-location.png" class="img-responsive"> <h4>Local</h4> <h5><b>Viamao</b></h5> </div> </div> <div class="col s6"> <div class="infos"> <img src="../../../assets/images/icon_calendario.png" class="img-responsive"> <h4>Data de Encerramento</h4> <h5><b>22/10/2018</b></h5> </div> <div class="infos"> <a class="waves-effect waves-light btn btn-inscricao">Inscrição</a> </div> </div> </div> </div> </div> </div> <!--</div>--> </div> </div>
Some times when I reload the page it loads with the property display: none and no transform property, and so nothing appears:
And when it appears its like that:
This happens in all browsers, some times the cards show, other times it doesn't.
The text was updated successfully, but these errors were encountered:
I have same issue, but i did not find the problem yet :(
Sorry, something went wrong.
I end up with something like this:
export class HomeComponent implements OnInit { public rodeos = []; @ViewChild('carousel') carouselElement; public showInitialized = false; public actions = new EventEmitter<string|MaterializeAction>(); constructor(private elementRef: ElementRef ) { window.setTimeout(() => { this.carouselElement.nativeElement.classList.toggle('initialized'); this.actions.emit('carousel'); }, 5000); } ... }
But still not the best solution. Setting TimeOut too 2000 sometimes didn't load the data from the api, setting to 5000 takes too long but its working.
No branches or pull requests
So, Im creating a carousel with data from the backend, I populate its array in the constructor function: this is my component.ts:
My html is like this:
Some times when I reload the page it loads with the property display: none and no transform property, and so nothing appears:
And when it appears its like that:
This happens in all browsers, some times the cards show, other times it doesn't.
The text was updated successfully, but these errors were encountered: