I am trying to implement bootstrap4 popover using jquery in angular7. I have included "popper.js" in index.html and included using npm too. but it's not working.
Uncaught TypeError: jquery__WEBPACK_IMPORTED_MODULE_2__(...).popover is not a function
this error only appears in the console.
HTML:(sample.component.html)
<button id="option2" autocomplete="off" data-toggle="popover"> Public</button>
Jquery: (sample.component.ts)
import { Component, OnInit } from '@angular/core';
import * as $ from 'jquery';
@Component({
selector: 'app-sample',
templateUrl: './sample.component.html',
styleUrls: ['./sample.component.css']
})
export class SampleComponent implements OnInit {
constructor() { }
ngOnInit() {
$(document).ready(function(){
$('[data-toggle="popover"]').popover();
$('#option2').popover({
html: true,
content: function() {
return $("#div").html();
},
placement: 'bottom'
});
});
}
How to achieve bootstrap popover in angular 7?