Open brunork26 opened 6 years ago
I have same issue, but i did not find the problem yet :(
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.
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.