mercredi 21 novembre 2018

Input text change checkbox model only once [AngularJS]

I have this

<input type="text" ng-click"function1()">

And this:

<input type="checkbox" ng-change="function2()" ng-model="stateCheck">

The functions do this:

$scope.function1 = function(){
  $scope.stateCheck = false;
}

$scope.function2 = function(){
  $scope.stateCheck = !$scope.stateCheck;
}

But the function1 just works the first time. Does anyone know why? Thanks.




Aucun commentaire:

Enregistrer un commentaire