1
I have a modal to edit user and when you have ng-model in input it does not display the value to edit. What I might be doing wrong.
$scope.updateUser = function(userId){
var id = userId;
$http.get("models/retornaUser.php?id=" + id).then(function(response) {
$scope.user = response.data;
$scope.userLogin = $scope.user[0].userLogin;
$scope.userName = $scope.user[0].userName;
$scope.userFone = $scope.user[0].userFone;
$scope.userEmail = $scope.user[0].userEmail;
$scope.userNivel = $scope.user[0].userNivel;
});
}
// button qe chama a modal passando id
<button class="btn btn-sm btn-indigo px-2" ng-click="updateUser(user.userId)" data-toggle="modal" data-target="#modalUser"><i class="fa fa-pencil fa-lg"></i></button>
// input modal com validacao de telefone
<div class="form-group col-sm-4">
<label for="userUFone">Fone</label>
<input type="text" name="userUFone" class="form-control form-control-sm" id="userUFone" ng-model="formDataUp.userUFone" ui-br-phone-number-mask maxlength="15" value="{{userFone}}">
</div>
Ricardo! If possible validate my answer! :)
– fabioxd20