Pass variable angularjs through function JS

1

I have a dynamic modal in Jquery that is called with onclick="ShowModal()" working. However, I want to send values coming from AngularJS and I can not. It sends the code AngularJS {{dado.idUser}} , but not the 01 value.

onclick="ShowModal('<?php echo URL.'Usuarios/?form=AlterarSenha&idu={{dado.idUser}}&nomeFunc={{dado.nomeFunc}}'; ?>',300,430)"

I made a test, I put only onclick="ShowModal({{dado.idUser}})" and I went to display the source code to see the result and it does not put the value, just the code.

Someone can help me with this. I do not understand much of Angular or JavaScript.

    
asked by anonymous 01.02.2017 / 17:58

1 answer

1

You can call a function and get the value using angular.element :

HTML

onclick="exibirModal()"

JS

function exibirModal(){
    var nome = angular.element('#idMeuController').scope().dado.nomeFunc;
    ShowModal(nome);
}

Where idMeuController is the id of the element that has its control.

    
01.02.2017 / 18:10