Currently, I am implementing a Tabbed Form with jQuery Functionality in Angular 4. The Tabbed Form itself is functioning, but I've noticed that I have to click the Tab Button twice for it to respond. See the code snippet below:
TS
declare var jquery: any;
declare var $: any;
export class AppComponent {
title = 'Angular App';
toggleEvent() {
$('.toggle').on('click', function() {
$('.container').stop().addClass('active');
});
$('.close').on('click', function() {
$('.container').stop().removeClass('active');
});
}
}
HTML
<div class="card alt" (click)="toggleEvent()">
..
..
</div>
Just to clarify, I have integrated jQuery functionality into my Angular 4 project because I am attempting to incorporate a Bootstrap (HTML, CSS, JS) App into Angular 4 to ensure my Tabbed Form functions seamlessly as it does in bootstrap.
However, why is it necessary to click the Tab Button twice before it responds? I have reviewed the code and can't seem to pinpoint what may be causing this issue.