Skip to content
Related Articles

Related Articles

Improve Article

Angular ngx Bootstrap Popover Component

  • Last Updated : 02 Sep, 2021
Geek Week

Angular ngx bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make responsive websites.

In this article we will know how to use Popover in angular ngx bootstrap. Popover is used to make a button that will be pop out by clicking on it.

Installation syntax:

npm install ngx-bootstrap --save 


  • First, install the angular ngx bootstrap using the above-mentioned command.


  • Add the following script in index.html

    <link href=”” rel=”stylesheet”>

  • Import popover component in module.ts
  • In app.component.html make a popover component.
  • Serve the app using ng serve.



<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    <base href="/" />
    <meta name="viewport" content=
        "width=device-width, initial-scale=1" />
    <link href=
        rel="stylesheet" />
    <link rel="icon" type="image/x-icon" href="favicon.ico" />
    <link rel="preconnect" href="" />
    <link href=
        rel="stylesheet" />
    <link href=
        rel="stylesheet" />
<body class="mat-typography">


<div id="pop">
    <button type="button" class="btn btn-default btn-success" 
        popover="Popover component in Angular ngx bootstrap."
        popoverTitle="GeeeksforGeeks" placement="top">
        Click here!
    <br />
    <br />
    <button type="button" class="btn btn-default btn-warning"
        popover="Popover component in Angular ngx bootstrap."
        popoverTitle="GeeeksforGeeks" placement="right">
        Click here!
    <br />
    <br />
    <button type="button" class="btn btn-default btn-danger" 
        popover="Popover component in Angular ngx bootstrap."
        popoverTitle="GeeeksforGeeks" placement="bottom">
        Click here!


import { NgModule } from '@angular/core';
// Importing forms module
import { FormsModule, ReactiveFormsModule }
    from '@angular/forms';
import { BrowserModule }
    from '@angular/platform-browser';
import { BrowserAnimationsModule }
    from '@angular/platform-browser/animations';
import { PopoverModule }
    from 'ngx-bootstrap/popover';
import { AppComponent } from './app.component';
    bootstrap: [
    declarations: [
    imports: [
export class AppModule { }


    margin: 50px;
    margin-top: 140px;


import { Component, OnInit,LOCALE_ID } from '@angular/core';
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
export class AppComponent {



My Personal Notes arrow_drop_up
Recommended Articles
Page :