2016-07-05 1 views
0

그래서 내가 요소어떻게 그런 다음 항목을 선택하고 편집 할 내가

$scope.customerList = []; 

의 배열을 가지고 드롭 다운 메뉴에서 편집 할 수있는 어떤 항목을 선택하기 위해 각 사용합니까 그것을

<select id="customerSelect" ng-model="customer" ng-options="item as item.Customer for item in customerList track by item.Customer"></select> 

그리고 나는 그것을

<div> 
    <label for="customer">Kundenavn</label> <input id="customer" ng-model="customer.Customer" /> 
</div> 
<div> 
    <label for="Account">Konto</label> <input id="Account" ng-model="customer.Account" /> 
</div> 

아이디어는 내가 항목을 편집 할 때, 목록에있는 항목이 업데이트되는 것을 물론이고, unfortantly 생을 편집 형태를 가지고 그럴 것 같지 않습니다. 이런 각도에서 기능을 얻는 가장 좋은 방법은 무엇입니까?

+0

설명 된 필드를 통해 신규 고객을 추가하거나 고객 모델을 얻는 방법은 무엇입니까? 더 많은 코드가 필요합니다. – Eugene

+0

작동하는 바이올린이 좋을 것입니다. – Aer0

+0

당신이 이런 종류의 물건을 찾고 있다면 https://plnkr.co/edit/mic9BTKUzlmTgZfD8LV2?p=preview – Prianca

답변

0

문제는 "track by item.Customer"마녀를 추적하여 양식의 입력을 변경하는 것입니다.

트릭은 "트랙 by"전체를 제거하는 것이었지만 예상대로 작동했습니다.

<select id="customerSelect" ng-model="customer" ng-options="item as item.Customer for item in customerList"></select> 
관련 문제