Сова карусель со статическими изображениями работает нормально.Когда изображения загружаются с сервера, они отображаются как есть и полностью растянуты.
Вот код компонента
getProductDetails(pid){
this.httpClient.get(this.baseUrl+`api/products/${pid}`)
.subscribe(
(data:any) => {
if(data){
this.prodImages = data.images;
if(this.prodImages != ''){
$('#product-images-carousel').owlCarousel({
items: 1
});
}
}
}
);
}
Вот этоСодержимое HTML
<div class="owl-carousel owl-theme" id="product-images-carousel">
<div class="item" *ngFor="let img of prodImages">
<img src="{{ baseUrl }}{{ img.image_path }}" class="thumbnail-image" alt="">
</div>
</div>
Я определил jQuery как показано ниже в компоненте
declare var $:any;
Для API я использую laravel.Функция контроллера Laravel:
public function show($id)
{
$product = DB::table('products')
->where('products.id', $id)
->first();
$images = DB::table('product_images')
->where('prod_id', $id)
->get();
$details = array();
$details['product'] = $product;
$details['images'] = $images;
return json_encode($details);
}