I'm trying to do a cleanup on a form, used $ setPristine () from angularJs ...
When attempting to clean a form with:
$scope.reset = function(){
$scope.form.$setPristine();
$scope.perfilDeAcesso = '';
};
It works normally but I'm trying to create a policy, and for the same function I need a code similar to this:
$scope.limpar = function(modelForm,modelObjeto){
console.log(modelForm);
console.log(modelObjeto);
modelObjeto = {};
modelForm.$setPristine();
};
My output on the console by double clicking on the button that calls the function
c {$error: Object, $name: "formPerfilDeAcesso", $dirty: true, $pristine: false, $valid: true…}
perfilDeAcessoCtrl.js:73
Object {itensPerfilDeAcesso: Array[3], nome: "ssssssssssssss"}
perfilDeAcessoCtrl.js:74
c {$error: Object, $name: "formPerfilDeAcesso", $dirty: false, $pristine: true, $valid: true…}
perfilDeAcessoCtrl.js:73
Object {itensPerfilDeAcesso: Array[3], nome: "ssssssssssssss"}
Can anyone tell me why?