다음 HTML을 가지고 있습니다. Angular에서 컨트롤러 내에서 Ui를 업데이트하는 방법
<div ng-controller="CustCtrl">
<table class="table table-condensed">
<thead>
etc.
</thead>
<tbody>
<tr ng-repeat="customer in customers" data-cust-id="{{customer.Id}}">
<td>
<button ng-model="Id" tracking-{{customer.Tracking}} ng-click="startTrackingCustById(customer.Id)">
</button>
</td>
etc.
</tr>
</tbody>
</table>
그래서 버튼은 true 또는 false입니다 customer.Tracking 값으로 데이터 바인딩 된 클래스가 있습니다. 버튼을 클릭하면 startTrackingCustById() 메서드가 성공적으로 호출되고 customers 객체의 customer 객체는 customer.Tracking = true처럼 성공적으로 변경됩니다.
그러나 단추 클래스는 업데이트되지 않습니다. 내가 뭘 놓치고 있니?
'ng-model = "Id"'은 무엇을 의미합니까? – SET
'class = "tracking - {{customer.Tracking}}' –