Cannot edit input

When i try to edit my input i get this error: “Cannot assign to read only property ‘prenom’ of #object i don’t know if it’s an angularjs bug or ionic

Please HELP

Controller:
============
VacancierResource.getVacById($stateParams.id).then(function(data){
    $scope.Evacancier = data;
 });

template:
=========

<label class="item item-input">
    <span class="input-label">Nom</span>
    <input type="text"  ng-model="Evacancier.nom">
</label>
<label class="item item-input">
    <span class="input-label">Prenom</span>
    <input type="text" ng-model="Evacancier.prenom">
</label>

Thank you in advance

any idea how to solve this guys ?

Is the “data” of your getVacById function really in the expected structure like

{
    prenom: ...,
    nom: ....
}

Are the values initialised like

$scope.Evacanier = {
    nom: '',
    prenom: ''
}

If you have more than 1 input field it is recommended to put a form around the inputs ;).

In other cases - a codepen would be great.

Thank’s for ur answer, the problem is that when i create a json it work’s good, so i think the problem come from my service, i use a wrapper that i found on internet https://gist.github.com/jgoux/10738978 does some one use it for update?

about codepen i have many files and i don’t see how to put them in a single page

Thank you for your time

Then you only have to map your data to get access to them.
Or you are checking your result data of your service and use the correct object as model

I was having exactly the same problem.

Do this on your controller:

$scope.Evacancier = angular.copy(data);

And you are good to go.