Angular 11/12 OWl Carousel Tutorial Example

Owl Carousel Example Angular 11/12. In this tutorial, we will explain how to use Owl Carousel in the Angular 11/12 app using the ngx-owl-carousel-o package.

This Angular tutorial is compatible with version 4+ including latest version 12, 11, 10, 9, 8 ,7, 6 & 5.

Owl Carousel Tutorial Example Angular 11/12

We simply need to follow the given steps for implementing the owl carousel in the Angular 12 app:


Step 1 is to Create the New Angular App

Step 2 is to Install the Owl Carousel Library

Step 3 is to Add Code on App.Module.ts File

Step 4 is to Add Code on View File

Step 5 is to Add Code On app.Component ts File

Step 6 is to Start the Angular App


Now, Let’s Learn in Detail

Step 1- Creating the New Angular App

First of all, open your terminal and execute the given command on it to install an angular app:

ng new owl-carousel-app

Step 2 : Installing the Owl Carousel Library

Next, just install the NPM package ngx-owl-carousel -save for implementing the owl carousel in the Angular app. Further, we can install the packages by executing the below-mentioned commands on the terminal:

npm install jquery --save
npm install ngx-owl-carousel-o

Then, we have to open the angular.json file and update the below code into it:

"styles": [
"scripts": [

Step 3: Adding Code on App.Module.ts File

Afterward, we visit the src/app directory and open the app.module.ts file. Thereafter, we also add the given lines into the app.module.ts file:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { CarouselModule } from 'ngx-owl-carousel-o';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
  declarations: [
  imports: [
  providers: [],
  bootstrap: [AppComponent]
export class AppModule { }

Step 4: Adding the Code on View File

In the next step, create the owl carousel in the Angular app. Then, we visit src/app/ and app.component.html after which, we update the following code into it:

<h1>Angular 11 Owl Carousel Integration Tutorial -</h1>
<owl-carousel-o [options]="customOptions">
<ng-container *ngFor="let slide of slides">
  <ng-template carouselSlide [id]="">
    <img [src]="slide.img" >

Step 5: Adding Code On app.Component ts File

Now, follow this step in which we visit the src/app directory and open app.component.ts.  After this, we add the following code into component.ts file:

import { Component } from '@angular/core';
import { OwlOptions } from 'ngx-owl-carousel-o';
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
export class AppComponent {
  title = 'ng-carousel-demo';
  customOptions: OwlOptions = {
    loop: true,
    mouseDrag: false,
    touchDrag: false,
    pullDrag: false,
    dots: false,
    navSpeed: 700,
    navText: ['', ''],
    responsive: {
      0: {
        items: 1
      400: {
        items: 2
      740: {
        items: 3
      940: {
        items: 4
    nav: true
    slides = [
      {id: 1, img: ""},
      {id: 2, img: ""},
      {id: 3, img: ""},
      {id: 4, img: ""},
      {id: 5, img: ""},
      {id: 6, img: ""},
      {id: 6, img: ""}

Step 6: Starting the Angular App

Lastly, we reach the final step of implementation where we execute the following command on the terminal to start the slick carousel in the angular app:

ng serve


Finally, we reach the end of using the owl carousel in the Angular 11/12 tutorial. In this tutorial, we have given a simple example with the help of which you can easily use the owl carousel yourself in your Angular app. 


Leave a Reply

Your email address will not be published. Required fields are marked *