Can we set the list of images for nativescript-ng2-carousel outside of the constructor?


I’ve added the nativescript-ng2-carousel plugin and need to be able to set the images based on data from a API request.

Currently the slideshow will work if i set the images array in the constructor as the demo shows.
But when I try to add images following the API request in the ngOnInit they won’t display.

   	 let newimages: Array<any> = [];
	     	for(let i=0; i< response.images.length; i++){
	     		let item = {title: 'Image'+i, url: response.images[i]};
	     	this.images = newimages;

I’m testing this in the iOS simulator


I think the plugin doesn’t support that, a easier fix could be adding a ngIf to the element so it won’t be rendered until your variable is initiated.


Thanks for the suggestion. This has worked for what I need.
Just need to be able fix the height to so it doesn’t exceed the device height in landscape view.