How to create a non-global variable?

0

How do I create an initial variable to write old data, and after editing on the form, make sure it is different?

Code:

app.controller("ModalController", ["$scope",function($scope){

 var fixa = [$scope.elemento_mutavel].slice()[0];

   if(fixa != $scope.elemento_mutavel) {
       //exemplo
   }

}]);

<input type="text" ng-model="elemento_mutavel">
    
asked by anonymous 26.09.2018 / 23:28

0 answers