1
I have a bizarre problem with a variable that I created in HTML with Angularjs. I even tried to instantiate it in Controller to see if that was the problem but no.
I have a button that on ng-click
i say that this variable (which has not yet been instantiated) becomes the opposite of it. To the button it works. It comes null
first, but by clicking the button a few times it gains value and becomes True
or False
(according to the click). I display this variable inside the button and it works. Now if I try to use it elsewhere, it doesn’t work.
<button type="button" ng-click="nova_variavel_criada = !nova_variavel_criada;">{$nova_variavel_criada$} . {$nova_variavel_criada ? 'PRIMEIRO CASO':'SEGUNDO CASO'$}</button>
AQUI ELA NÃO PRINTA NENHUM RESULTADO: {$nova_variavel_criada$}
About the {$ $}
is because I use Django and had to change the keys.
Inside the button, when clicking, the phrase changes normally. Even the print behind appears "TRUE" and "FALSE" according to Click. The problem is outside the button, nothing appears.