0

i got a Model in a ng-repeat :

<tr ng-repeat="expert in experts">
                <td>{{expert.expertName}}</td>
                <td ng-mouseleave="editMode = false">
                    <span ng-hide="editMode" ng-click="editMode = !editMode">{{expert.mail}}</span>
                    <input class="width100" type="text" ng-show="editMode" value="{{expert.mail}}" />
                </td>
                <td><input class="width100" type="checkbox" ng-model="expert.locked" ng-click="showSaveButton = ! showSaveButton"/></td>
                <td class="width100">
                    <input type="button" class="btn btn-primary btn-success" ng-show="showSaveButton" value="SAVE" ng-click="confirmSave(expert)" />
                    <input type="button" class="btn-warning btn-primary btn" value="GENERATE" ng-click="" />
                </td>
            </tr>

So the Problem is here :

<td ng-mouseleave="editMode = false">
                    <span ng-hide="editMode" ng-click="editMode = !editMode" ng-animate>{{expert.mail}}</span>
                    <input class="width100" type="text" ng-show="editMode" value="{{expert.mail}}" />
                </td>

When i enter the edit mode, i can edit the input field. When i leave, the span is not updating.

Any suggestions ?

1

1 Answer 1

1

you can use ng-model instead of value ={{expert.email}}

   <input class="width100" type="text" ng-show="editMode" ng-model="expert.mail" />
Sign up to request clarification or add additional context in comments.

3 Comments

Than doesn't answer the question. It should be written as a comment.
Thank your for your suggestion. I am new to this site, will do that next time.
Welcome to SO Kiran. Your answer is correct, but I edited your HTML solution as in your explanation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.