Variables AngularJS | SoloLearn: Learn to code for FREE!

+1

Variables AngularJS

Estoy haciendo un minijuego de hitterclick con AngularJS. Todo funciona bien, cuando presionas un boton se suma uno a una variable y luego le resta uno a la otra variable. Ahi todo bien. Pero cuabdo quiero detectar que una variable llego a cero (osea que perdio) ¿como se hace? intente con javascript separado y adentro de la funcion $scope esa. Como se hace? Soy @URROVA https://code.sololearn.com/W2WL25b21iHN/?ref=app

8/17/2018 2:17:02 PM

URROVA

4 Answers

New Answer

+1

ok I just saw you code and it seems that you need to add a condition if counter goes below zero then return 0 you can refer below link example: www.dotnetfunda.com/codes/show/7804/button-incrementdecrement-value-using-ng-click

+1

https://code.sololearn.com/W2WL25b21iHN/?ref=app

0

Variables AngularJS I'm doing a hitterclick minigame with AngularJS. Everything works fine, when you press a button it adds one variable and then subtracts one from the other variable. There everything is fine. But when I want to detect that a variable arrived at zero (what did it lose), how is it done? try with separate javascript and inside the $ scope function. How is it done? I am @URROVA @URROVA please share your code so developers may help you regarding the same.

0