

Next, update the Component class with imageObject array, that will have various image properties including original image URL, thumbnail image, title and alt text. The property binding will take the image Object. To implement the Lightbox Slider, we will add the ng-image-slider directive in the template HTML. We are ready to see the carousel working. Open the file and update as shown below.

npm install ng-image-sliderĪfter installing the package, we need to import the NgImageSliderModule in the main app module to make it available throughout our application components. Now, open the terminal and install the ng-image-slider package into the Angular project. ng new angular-lightbox-slider-appĮnter into the project directory cd angular-lightbox-slider-app npm install -g run the ng command to create a new application or you can continue with existed Angular project if you already have one. You need to have Angular CLI installed, which provide CLI command to create Angular project easily.

Angular material image carousel how to#
How to Create Image Slider/ Carousel with Zoom in Angular application? Using ng-image-slider we can add responsive sliders which can adapt to any screen size. Today we will create an exquisite slider/ carousel in which a user can click on the image slide to view its full-sized / original image in popup or lightbox with zoom effect. It is usually shown as focused content for users to take actions like filling up forms, mark content, show detailed data etc. This Angular tutorial is compatible with version 4+ including latest version 12, 11, 10, 9, 8 ,7, 6 & 5.Ī lightbox or popup is a floating UI component that appears on top of the other page content.
