Is it possible to update the this.variable of the AuthDirective class using a jQuery function?
I may have a basic question, but I need to trigger Jquery events and manipulate Angular variables.
import { Component, Directive, OnInit } from '@angular/core';
import { AppGlobal } from '../../../app.global';
declare var $:any;
@Component({
selector : 'authorization',
templateUrl : './auth.directive.html'
})
export class AuthDirective {
isCaptcha : boolean = false;
constructor(
public app : AppGlobal
) {
}
ngOnInit() {
$('.sign-up-label').on('show.bs.modal', function (e) {
this.isCaptcha = true; // ISSUE IN THIS CONTEXT, BUT WORKS IN THAT CONTEXT
})
}
}
{{isCaptcha}} always evaluates to false
<div class="form-group ta-web-right mt-3" *ngIf="isCaptcha">
<re-captcha (resolved)="resolved($event)"></re-captcha>
</div>
Any assistance would be appreciated.