I am trying to display image on the body using jQuery in my angular application. jQuery script is not working in my angular application for popup. I am not able to find out where is the issue.So, How to resolve this issue?
app.component.ts:
ngOnInit() {
var container = $('<div id="container"></div>');
container.show();
setTimeout(function () {
container.appendTo(document.body);
}, 10000);
$('.popupbox').show();
$('.close').click(function () {
$('.popupbox').hide();
container.appendTo(document.body).remove();
return false;
});
$('.close').click(function () {
$('.popupbox').hide();
container.appendTo(document.body).remove();
return false;
});
}
Demo: https://stackblitz.com/edit/angular-jquery-modal-uvr9f4?file=app%2Fapp.component.ts