# Cannot edit input

**URL:** <https://forum.ionicframework.com/t/cannot-edit-input/6905>\
**Category:** ionic-v1\
**Created:** [July 15, 2014, 8:43pm UTC](https://forum.ionicframework.com/t/cannot-edit-input/6905 "2014-07-15T20:43:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbenzine](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nbenzine](https://forum.ionicframework.com/u/nbenzine)\
**Post date:** [July 15, 2014, 8:43pm UTC](https://forum.ionicframework.com/t/cannot-edit-input/6905/1 "2014-07-15T20:43:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nbenzine](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nbenzine](https://forum.ionicframework.com/u/nbenzine)\
**Post date:** [July 16, 2014, 9:54am UTC](https://forum.ionicframework.com/t/cannot-edit-input/6905/2 "2014-07-16T09:54:00Z")

</div>

any idea how to solve this guys ?

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [July 16, 2014, 1:37pm UTC](https://forum.ionicframework.com/t/cannot-edit-input/6905/3 "2014-07-16T13:37:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nbenzine](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nbenzine](https://forum.ionicframework.com/u/nbenzine)\
**Post date:** [July 25, 2014, 6:31am UTC](https://forum.ionicframework.com/t/cannot-edit-input/6905/4 "2014-07-25T06:31:49Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [July 25, 2014, 6:58am UTC](https://forum.ionicframework.com/t/cannot-edit-input/6905/5 "2014-07-25T06:58:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![igorprado](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/igorprado/32/68963_2.png) [@igorprado](https://forum.ionicframework.com/u/igorprado)\
**Post date:** [January 12, 2015, 11:35pm UTC](https://forum.ionicframework.com/t/cannot-edit-input/6905/6 "2015-01-12T23:35:47Z")

</div>

I was having exactly the same problem.

Do this on your controller:

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

```

And you are good to go.
