Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to build an image carousel using angular material?

i am trying to develop an image carousel using angular material but i couldn't find any helpful resource.

I tried out https://github.com/gbrlsnchs/material2-carousel but didn't work and the code is complex.

like image 321
Sachini Avatar asked Oct 25 '25 05:10

Sachini


1 Answers

Here is example for you

<ng-template #slide let-slide>
    <div [ngStyle]="{
      'background-size': 'cover',
      'background-image': 'url(' + slide.url + ')',
      'background-repeat': 'no-repeat',
      'width': '100%',
      'height': '100%'
    }">
    </div>
</ng-template>
<ng-template #thumbnail let-slide>
        <div [ngStyle]="{
        'background-size': 'cover',
        'background-image': 'url(' + slide.url + ')',
        'background-repeat': 'no-repeat',
        'background-position': 'center center',
        'width': '100%',
        'height': '100%'
      }"></div>
</ng-template>
like image 119
Chanaka Weerasinghe Avatar answered Oct 27 '25 20:10

Chanaka Weerasinghe