I'm having a hard time applying Javascript in my Angular project, I got it right in the configuration to connect the javascript in the project, but come on ...
This is the Javascript file;
var Brewer = Brewer || {};
Brewer.MascaraCpfCnpj = (function() {
function MascaraCpfCnpj() {
this.radioTipoPessoa = $('.js-radio-tipo-pessoa');
}
MascaraCpfCnpj.prototype.iniciar = function() {
this.radioTipoPessoa.on('change', onTipoPessoaAlterado.bind(this));
}
function onTipoPessoaAlterado(evento) {
console.log('evento', evento);
}
return MascaraCpfCnpj;
}());
$(function() {
var mascaraCpfCnpj = new Brewer.MascaraCpfCnpj();
mascaraCpfCnpj.iniciar();
});
And this is the snippet of the Javascript file that was applied to the event;
<div class="ui-g-12 ui-lg-3 ui-md-6 ui-fluid">
<label for="id_FISICA">Tipo de Pessoa Física</label>
<div class="radio">
<p-radioButton class="js-radio-tipo-pessoa" name="group1" value="Física" id="id_FISICA" [(ngModel)]="tipo" inputId="tipo"></p-radioButton>
</div>
</div>
<div class="ui-g-12 ui-lg-3 ui-md-6 ui-fluid">
<label for="id_JURIDICA">Tipo de Pessoa Júridica</label>
<div class="radio">
<p-radioButton class="js-radio-tipo-pessoa" name="group1" value="Juridica" id="id_JURIDICA" [(ngModel)]="tipo" inputId="tipo"></p-radioButton>
</div>
</div>
It was to appear something in the browser console when you click on the radioButton, but nothing appears, nothing at all.
I'm open to suggestions